Skip to content
Commit 48b491a5 authored by George McCollister's avatar George McCollister Committed by David S. Miller
Browse files

net: hsr: fix mac_len checks

Commit 2e9f6093 ("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: 2e9f6093

 ("net: hsr: check skb can contain struct hsr_ethhdr in fill_frame_info")
Signed-off-by: default avatarGeorge McCollister <george.mccollister@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a4dd4fc6
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment