Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: dsa: Fix Marvell Egress Trailer check

The Marvell Egress rx trailer check must be fixed to
correctly detect bad bits in the third byte of the
Eggress trailer as described in the Table 28 of the
88E6060 datasheet.
The current code incorrectly omits to check the third
byte and checks the fourth byte twice.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Neil Armstrong and committed by
David S. Miller
fbd03513 7def0f95

+1 -1
+1 -1
net/dsa/tag_trailer.c
··· 78 78 79 79 trailer = skb_tail_pointer(skb) - 4; 80 80 if (trailer[0] != 0x80 || (trailer[1] & 0xf8) != 0x00 || 81 - (trailer[3] & 0xef) != 0x00 || trailer[3] != 0x00) 81 + (trailer[2] & 0xef) != 0x00 || trailer[3] != 0x00) 82 82 goto out_drop; 83 83 84 84 source_port = trailer[1] & 7;