]> git.baikalelectronics.ru Git - kernel.git/commit
net: hsr: Properly parse HSRv1 supervisor frames.
authorLukasz Majewski <lukma@denx.de>
Fri, 15 Sep 2023 18:10:02 +0000 (20:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Oct 2023 12:56:39 +0000 (14:56 +0200)
commit8ef5cc6b4ef0ac687aa4f45bde723b03e30f7fd6
tree1a0952d55505420c298e62411fc7108d965ed458
parenteef16bfdb212da60f5144689f2967fb25b051a2b
net: hsr: Properly parse HSRv1 supervisor frames.

[ Upstream commit 295de650d3aaf9e50258465c5f1c84b465d836f6 ]

While adding support for parsing the redbox supervision frames, the
author added `pull_size' and `total_pull_size' to track the amount of
bytes that were pulled from the skb during while parsing the skb so it
can be reverted/ pushed back at the end.
In the process probably copy&paste error occurred and for the HSRv1 case
the ethhdr was used instead of the hsr_tag. Later the hsr_tag was used
instead of hsr_sup_tag. The later error didn't matter because both
structs have the size so HSRv0 was still working. It broke however HSRv1
parsing because struct ethhdr is larger than struct hsr_tag.

Reinstate the old pulling flow and pull first ethhdr, hsr_tag in v1 case
followed by hsr_sup_tag.

[bigeasy: commit message]

Fixes: eafaa88b3eb7 ("net: hsr: Add support for redbox supervision frames")'
Suggested-by: Tristram.Ha@microchip.com
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/hsr/hsr_framereg.c