hsr: Fix supervision frame sending on HSRv0
authorFelix Maurer <fmaurer@redhat.com>
Tue, 11 Nov 2025 16:29:32 +0000 (17:29 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 13 Nov 2025 14:55:04 +0000 (15:55 +0100)
commit96a3a03abf3d8cc38cd9cb0d280235fbcf7c3f7f
tree4c8ec8660fd188985b4ed577ef4db6573dce2b85
parent0eff2eaa5322b5b141ff5d5ded26fac4a52b5f7b
hsr: Fix supervision frame sending on HSRv0

On HSRv0, no supervision frames were sent. The supervison frames were
generated successfully, but failed the check for a sufficiently long mac
header, i.e., at least sizeof(struct hsr_ethhdr), in hsr_fill_frame_info()
because the mac header only contained the ethernet header.

Fix this by including the HSR header in the mac header when generating HSR
supervision frames. Note that the mac header now also includes the TLV
fields. This matches how we set the headers on rx and also the size of
struct hsrv0_ethhdr_sp.

Reported-by: Hangbin Liu <liuhangbin@gmail.com>
Closes: https://lore.kernel.org/netdev/aMONxDXkzBZZRfE5@fedora/
Fixes: 9cfb5e7f0ded ("net: hsr: fix hsr_init_sk() vs network/transport headers.")
Signed-off-by: Felix Maurer <fmaurer@redhat.com>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://patch.msgid.link/4354114fea9a642fe71f49aeeb6c6159d1d61840.1762876095.git.fmaurer@redhat.com
Tested-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/hsr/hsr_device.c