Skip to content

Commit

Permalink
net/packet: Improve the comment about LL header visibility criteria
Browse files Browse the repository at this point in the history
The "dev_has_header" function, recently added in
commit d549699 ("net/packet: fix packet receive on L3 devices
without visible hard header"),
is more accurate as criteria for determining whether a device exposes
the LL header to upper layers, because in addition to dev->header_ops,
it also checks for dev->header_ops->create.

When transmitting an skb on a device, dev_hard_header can be called to
generate an LL header. dev_hard_header will only generate a header if
dev->header_ops->create is present.

Signed-off-by: Xie He <[email protected]>
Acked-by: Willem de Bruijn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
Xie He authored and kuba-moo committed Feb 6, 2021
1 parent 163a180 commit 21c8597
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ Resume
On transmit:
------------
dev->header_ops != NULL
dev_has_header(dev) == true
mac_header -> ll header
data -> ll header
dev->header_ops == NULL (ll header is invisible to us)
dev_has_header(dev) == false (ll header is invisible to us)
mac_header -> data
data -> data
Expand Down

0 comments on commit 21c8597

Please sign in to comment.