tmp_suning_uos_patched/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 net: hsr: Convert to DEFINE_SHOW_ATTRIBUTE 2020-09-17 17:05:10 -07:00
hsr_device.c net: hsr: fix mac_len checks 2021-06-03 09:00:50 +02:00
hsr_device.h hsr: enhance netlink socket interface to support PRP 2020-07-27 12:20:40 -07:00
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: enhance netlink socket interface to support PRP 2020-07-27 12:20:40 -07:00
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: enhance netlink socket interface to support PRP 2020-07-27 12:20:40 -07:00
hsr_slave.c net: hsr: fix mac_len checks 2021-06-03 09:00:50 +02:00
hsr_slave.h net: prp: add packet handling support 2020-07-27 12:20:40 -07:00
Kconfig hsr: enhance netlink socket interface to support PRP 2020-07-27 12:20:40 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00