aboutsummaryrefslogtreecommitdiffstats
path: root/net/hsr/hsr_main.h
diff options
context:
space:
mode:
authorGeorge McCollister <george.mccollister@gmail.com>2021-05-24 13:50:54 -0500
committerDavid S. Miller <davem@davemloft.net>2021-05-24 14:10:28 -0700
commit48b491a5cc74333c4a6a82fe21cea42c055a3b0b (patch)
tree26ea4fa3badf5fbf8bd12d290a8c81a75250a25e /net/hsr/hsr_main.h
parentnet: appletalk: cops: Fix data race in cops_probe1 (diff)
downloadlinux-dev-48b491a5cc74333c4a6a82fe21cea42c055a3b0b.tar.xz
linux-dev-48b491a5cc74333c4a6a82fe21cea42c055a3b0b.zip
net: hsr: fix mac_len checks
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>
Diffstat (limited to 'net/hsr/hsr_main.h')
-rw-r--r--net/hsr/hsr_main.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h
index 8f264672b70b..53d1f7a82463 100644
--- a/net/hsr/hsr_main.h
+++ b/net/hsr/hsr_main.h
@@ -186,8 +186,8 @@ struct hsr_proto_ops {
struct hsr_port *port);
struct sk_buff * (*create_tagged_frame)(struct hsr_frame_info *frame,
struct hsr_port *port);
- void (*fill_frame_info)(__be16 proto, struct sk_buff *skb,
- struct hsr_frame_info *frame);
+ int (*fill_frame_info)(__be16 proto, struct sk_buff *skb,
+ struct hsr_frame_info *frame);
bool (*invalid_dan_ingress_frame)(__be16 protocol);
void (*update_san_info)(struct hsr_node *node, bool is_sup);
};