kernel_optimize_test/net/hsr
George McCollister f6442ee08f net: hsr: fix mac_len checks
[ Upstream commit 48b491a5cc74333c4a6a82fe21cea42c055a3b0b ]

Commit 2e9f60932a2c ("net: hsr: check skb can contain struct hsr_ethhdr
in fill_frame_info") added the following which resulted in -EINVAL
always being returned:
	if (skb->mac_len < sizeof(struct hsr_ethhdr))
		return -EINVAL;

mac_len was not being set correctly so this check completely broke
HSR/PRP since it was always 14, not 20.

Set mac_len correctly and modify the mac_len checks to test in the
correct places since sometimes it is legitimately 14.

Fixes: 2e9f60932a2c ("net: hsr: check skb can contain struct hsr_ethhdr in fill_frame_info")
Signed-off-by: George McCollister <george.mccollister@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-03 09:00:50 +02:00
..
hsr_debugfs.c
hsr_device.c net: hsr: fix mac_len checks 2021-06-03 09:00:50 +02:00
hsr_device.h
hsr_forward.c net: hsr: fix mac_len checks 2021-06-03 09:00:50 +02:00
hsr_forward.h net: hsr: fix mac_len checks 2021-06-03 09:00:50 +02:00
hsr_framereg.c net: hsr: add support for EntryForgetTime 2021-03-07 12:34:07 +01:00
hsr_framereg.h net: hsr: add support for EntryForgetTime 2021-03-07 12:34:07 +01:00
hsr_main.c
hsr_main.h net: hsr: fix mac_len checks 2021-06-03 09:00:50 +02:00
hsr_netlink.c genetlink: move to smaller ops wherever possible 2020-10-02 19:11:11 -07:00
hsr_netlink.h
hsr_slave.c net: hsr: fix mac_len checks 2021-06-03 09:00:50 +02:00
hsr_slave.h
Kconfig
Makefile