• Jiri Benc's avatar
    gre: do not assign header_ops in collect metadata mode · a64b04d8
    Jiri Benc authored
    In ipgre mode (i.e. not gretap) with collect metadata flag set, the tunnel
    is incorrectly assumed to be mGRE in NBMA mode (see commit 6a5f44d7).
    This is not the case, we're controlling the encapsulation addresses by
    lwtunnel metadata. And anyway, assigning dev->header_ops in collect metadata
    mode does not make sense.
    
    Although it would be more user firendly to reject requests that specify
    both the collect metadata flag and a remote/local IP address, this would
    break current users of gretap or introduce ugly code and differences in
    handling ipgre and gretap configuration. Keep the current behavior of
    remote/local IP address being ignored in such case.
    
    v3: Back to v1, added explanation paragraph.
    v2: Reject configuration specifying both remote/local address and collect
        metadata flag.
    
    Fixes: 2e15ea39 ("ip_gre: Add support to collect tunnel metadata.")
    Signed-off-by: default avatarJiri Benc <jbenc@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a64b04d8
ip_gre.c 34.2 KB