]> Git Repo - linux.git/commit
net: hsr: Use correct offset for HSR TLV values in supervisory HSR frames
authorLukasz Majewski <[email protected]>
Wed, 28 Feb 2024 08:56:44 +0000 (09:56 +0100)
committerPaolo Abeni <[email protected]>
Thu, 29 Feb 2024 09:42:46 +0000 (10:42 +0100)
commit51dd4ee0372228ffb0f7709fa7aa0678d4199d06
tree5624db264d15a87ea2a6d3dd6a26c5f72ddef99a
parent0bb7b09392eb74b152719ae87b1ba5e4bf910ef0
net: hsr: Use correct offset for HSR TLV values in supervisory HSR frames

Current HSR implementation uses following supervisory frame (even for
HSRv1 the HSR tag is not is not present):

00000000: 01 15 4e 00 01 2d XX YY ZZ 94 77 10 88 fb 00 01
00000010: 7e 1c 17 06 XX YY ZZ 94 77 10 1e 06 XX YY ZZ 94
00000020: 77 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000030: 00 00 00 00 00 00 00 00 00 00 00 00

The current code adds extra two bytes (i.e. sizeof(struct hsr_sup_tlv))
when offset for skb_pull() is calculated.
This is wrong, as both 'struct hsrv1_ethhdr_sp' and 'hsrv0_ethhdr_sp'
already have 'struct hsr_sup_tag' defined in them, so there is no need
for adding extra two bytes.

This code was working correctly as with no RedBox support, the check for
HSR_TLV_EOT (0x00) was off by two bytes, which were corresponding to
zeroed padded bytes for minimal packet size.

Fixes: eafaa88b3eb7 ("net: hsr: Add support for redbox supervision frames")
Signed-off-by: Lukasz Majewski <[email protected]>
Reviewed-by: Jiri Pirko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
net/hsr/hsr_forward.c
This page took 0.059591 seconds and 4 git commands to generate.