diff options
author | Edward Cree <ecree@solarflare.com> | 2017-09-19 18:45:56 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-12 11:56:04 +0200 |
commit | bf324b4822c9a2419d00b273ba8a5d36298203be (patch) | |
tree | 2d9c131ddaa8c132e22b9392c5fe15e8f1eeb19b /net | |
parent | dcc738d393156dd29ed961ecefe13d96ed5f782f (diff) |
net: change skb->mac_header when Generic XDP calls adjust_head
[ Upstream commit 92dd5452c1be873a1193561f4f691763103d22ac ]
Since XDP's view of the packet includes the MAC header, moving the start-
of-packet with bpf_xdp_adjust_head needs to also update the offset of the
MAC header (which is relative to skb->head, not to the skb->data that was
changed).
Without this, tcpdump sees packets starting from the old MAC header rather
than the new one, at least in my tests on the loopback device.
Fixes: b5cdae3291f7 ("net: Generic XDP")
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 86b4b0a79e7a..6fa30a4c60ef 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4408,6 +4408,7 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb, __skb_pull(skb, off); else if (off < 0) __skb_push(skb, -off); + skb->mac_header += off; switch (act) { case XDP_TX: |