diff options
author | Cong Wang <cwang@twopensource.com> | 2014-06-12 11:53:10 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-26 15:12:39 -0400 |
commit | 1d7716d95bc77b3fa128f1de50900d02b2c0f4d9 (patch) | |
tree | 812f0f33f8c06c236a20063bf601c525f0f96a6b /drivers/net | |
parent | fb0d10bff97d0016a8305d6102699a93afe5011a (diff) | |
download | linux-3.10-1d7716d95bc77b3fa128f1de50900d02b2c0f4d9.tar.gz linux-3.10-1d7716d95bc77b3fa128f1de50900d02b2c0f4d9.tar.bz2 linux-3.10-1d7716d95bc77b3fa128f1de50900d02b2c0f4d9.zip |
vxlan: use dev->needed_headroom instead of dev->hard_header_len
[ Upstream commit 2853af6a2ea1a8ed09b09dd4fb578e7f435e8d34 ]
When we mirror packets from a vxlan tunnel to other device,
the mirror device should see the same packets (that is, without
outer header). Because vxlan tunnel sets dev->hard_header_len,
tcf_mirred() resets mac header back to outer mac, the mirror device
actually sees packets with outer headers
Vxlan tunnel should set dev->needed_headroom instead of
dev->hard_header_len, like what other ip tunnels do. This fixes
the above problem.
Cc: "David S. Miller" <davem@davemloft.net>
Cc: stephen hemminger <stephen@networkplumber.org>
Cc: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/vxlan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 9673edfff45..fcbd4eee52c 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -1314,7 +1314,7 @@ static void vxlan_setup(struct net_device *dev) eth_hw_addr_random(dev); ether_setup(dev); - dev->hard_header_len = ETH_HLEN + VXLAN_HEADROOM; + dev->needed_headroom = ETH_HLEN + VXLAN_HEADROOM; dev->netdev_ops = &vxlan_netdev_ops; dev->destructor = vxlan_free; @@ -1454,7 +1454,7 @@ static int vxlan_newlink(struct net *net, struct net_device *dev, dev->mtu = lowerdev->mtu - VXLAN_HEADROOM; /* update header length based on lower device */ - dev->hard_header_len = lowerdev->hard_header_len + + dev->needed_headroom = lowerdev->hard_header_len + VXLAN_HEADROOM; } |