From 21c85974aab7211619d39364990427af543c88ac Mon Sep 17 00:00:00 2001 From: Xie He Date: Fri, 5 Feb 2021 14:41:24 -0800 Subject: [PATCH] net/packet: Improve the comment about LL header visibility criteria The "dev_has_header" function, recently added in commit d549699048b4 ("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 Acked-by: Willem de Bruijn Link: https://lore.kernel.org/r/20210205224124.21345-1-xie.he.0141@gmail.com Signed-off-by: Jakub Kicinski --- net/packet/af_packet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 6bbc7a448593..e24b2841c643 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -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