• George McCollister's avatar
    net: hsr: fix mac_len checks · 48b491a5
    George McCollister authored
    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>
    48b491a5
hsr_main.h 8.55 KB