diff options
| author | Eyal Birger <[email protected]> | 2020-11-21 06:28:17 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2020-11-24 01:29:36 +0000 |
| commit | d549699048b4b5c22dd710455bcdb76966e55aa3 (patch) | |
| tree | 54881cbdf344f66ae28ee9e5106e419381bc199b /net/ipv6/tcp_ipv6.c | |
| parent | i40e: Fix removing driver while bare-metal VFs pass traffic (diff) | |
| download | kernel-d549699048b4b5c22dd710455bcdb76966e55aa3.tar.gz kernel-d549699048b4b5c22dd710455bcdb76966e55aa3.zip | |
net/packet: fix packet receive on L3 devices without visible hard header
In the patchset merged by commit b9fcf0a0d826
("Merge branch 'support-AF_PACKET-for-layer-3-devices'") L3 devices which
did not have header_ops were given one for the purpose of protocol parsing
on af_packet transmit path.
That change made af_packet receive path regard these devices as having a
visible L3 header and therefore aligned incoming skb->data to point to the
skb's mac_header. Some devices, such as ipip, xfrmi, and others, do not
reset their mac_header prior to ingress and therefore their incoming
packets became malformed.
Ideally these devices would reset their mac headers, or af_packet would be
able to rely on dev->hard_header_len being 0 for such cases, but it seems
this is not the case.
Fix by changing af_packet RX ll visibility criteria to include the
existence of a '.create()' header operation, which is used when creating
a device hard header - via dev_hard_header() - by upper layers, and does
not exist in these L3 devices.
As this predicate may be useful in other situations, add it as a common
dev_has_header() helper in netdevice.h.
Fixes: b9fcf0a0d826 ("Merge branch 'support-AF_PACKET-for-layer-3-devices'")
Signed-off-by: Eyal Birger <[email protected]>
Acked-by: Jason A. Donenfeld <[email protected]>
Acked-by: Willem de Bruijn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
0 files changed, 0 insertions, 0 deletions
