Skip to content

Commit

Permalink
net: hsr: fix incorrect lsdu size in the tag of HSR frames for small …
Browse files Browse the repository at this point in the history
…frames

For small Ethernet frames with size less than minimum size 66 for HSR
vs 60 for regular Ethernet frames, hsr driver currently doesn't pad the
frame to make it minimum size. This results in incorrect LSDU size being
populated in the HSR tag for these frames. Fix this by padding the frame
to the minimum size applicable for HSR.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Murali Karicheri authored and David S. Miller committed Jul 18, 2020
1 parent 7f5f814 commit 6d6148b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/hsr/hsr_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ static void hsr_fill_tag(struct sk_buff *skb, struct hsr_frame_info *frame,
int lane_id;
int lsdu_size;

/* pad to minimum packet size which is 60 + 6 (HSR tag) */
skb_put_padto(skb, ETH_ZLEN + HSR_HLEN);

if (port->type == HSR_PT_SLAVE_A)
lane_id = 0;
else
Expand Down

0 comments on commit 6d6148b

Please sign in to comment.