]> git.baikalelectronics.ru Git - kernel.git/commit
net/packet: Fix a comment about mac_header
authorXie He <xie.he.0141@gmail.com>
Wed, 16 Sep 2020 12:23:08 +0000 (05:23 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Sep 2020 23:24:45 +0000 (16:24 -0700)
commitd21a48c588598d83c9220458f02349e0d54fb4e4
tree8a5d58614be60dfdce8d3be8c5bf9ecfe4a2fa66
parent59c1623be7fbe50bdad4efe861b5d435e1ddcd51
net/packet: Fix a comment about mac_header

1. Change all "dev->hard_header" to "dev->header_ops"

2. On receiving incoming frames when header_ops == NULL:

The comment only says what is wrong, but doesn't say what is right.
This patch changes the comment to make it clear what is right.

3. On transmitting and receiving outgoing frames when header_ops == NULL:

The comment explains that the LL header will be later added by the driver.

However, I think it's better to simply say that the LL header is invisible
to us. This phrasing is better from a software engineering perspective,
because this makes it clear that what happens in the driver should be
hidden from us and we should not care about what happens internally in the
driver.

4. On resuming the LL header (for RAW frames) when header_ops == NULL:

The comment says we are "unlikely" to restore the LL header.

However, we should say that we are "unable" to restore it.
It's not possible (rather than not likely) to restore it, because:

1) There is no way for us to restore because the LL header internally
processed by the driver should be invisible to us.

2) In function packet_rcv and tpacket_rcv, the code only tries to restore
the LL header when header_ops != NULL.

Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Signed-off-by: Xie He <xie.he.0141@gmail.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c