]> git.baikalelectronics.ru Git - kernel.git/commit
net: change skb->mac_header when Generic XDP calls adjust_head
authorEdward Cree <ecree@solarflare.com>
Tue, 19 Sep 2017 17:45:56 +0000 (18:45 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Sep 2017 22:44:22 +0000 (15:44 -0700)
commit2fd604d732d4060ae25f149c6e4cde6c9a5eb8ce
tree664288c91b1120f000c5217c3bfb64595acc1f82
parentc932f534982d6203dd97b7c09de7beed0d968cf9
net: change skb->mac_header when Generic XDP calls adjust_head

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: d03010cc6121 ("net: Generic XDP")
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c