Thread (25 messages) 25 messages, 3 authors, 10d ago

Re: [PATCH net-next v8 1/8] hsr: Add header_ops::parse_protocol

flat view

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: 2026-10-12 13:13:21

On 2026-10-06 14:31:12 [+0000], netdev-bot+sashiko@kernel.org wrote:
[Severity: Low]
This isn't a bug, but could the commit message also say why this is
needed?

The description is correct. In net/packet/af_packet.c,
packet_parse_headers() does:

    if ((!skb->protocol || skb->protocol == htons(ETH_P_ALL)) &&
        sock->type == SOCK_RAW)
        skb->protocol = dev_parse_header_protocol(skb);

    skb_probe_transport_header(skb);

As far as I can tell, the reason for the change is the later patch in
this series, "hsr: Add a magic header for sending PTP packets". That
patch adds this check in hsr_dev_xmit():

    if (skb->protocol == htons(ETH_P_1588)) {

A SOCK_RAW sender bound to protocol 0 or ETH_P_ALL only passes that
check because of this callback. Should the message mention this
dependency?
Yes. It is missing for the HSR case so I added it in order to make the
mentioned check work.
Users of the hsr device will also see some changes. They now get the
real ethertype instead of 0 in these places:

  - skb_probe_transport_header()
  - the VLAN network header adjustment in packet_parse_headers()
  - tc/clsact protocol matching on the hsr device
  - taps on the hsr device

There is also no Fixes: tag. Could the message say whether this is a
standalone fix or a prerequisite for the PTP work, so backporters can
decide whether they need it?
I'm not aware of anything broken so it is just a prerequisite for this
series. Therefore no Fixes tag.

Sebastian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help