All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2 v2] net: hsr: fix incorrect lsdu size in the tag of HSR frames for small frames
@ 2020-07-17 14:55 Murali Karicheri
  2020-07-17 14:55 ` [PATCH 2/2 v2] net: hsr: validate address B before copying to skb Murali Karicheri
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Murali Karicheri @ 2020-07-17 14:55 UTC (permalink / raw)
  To: davem, kuba, netdev, linux-kernel, nsekhar, grygorii.strashko,
	vinicius.gomes

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>
---
 no change from original version
 Sending this bug fix ahead of PRP patch series as per comment
 net/hsr/hsr_forward.c | 3 +++
 1 file changed, 3 insertions(+)

 Sending this bug fix ahead of PRP patch series as per comment
diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
index ed13760463de..e42fd356f073 100644
--- a/net/hsr/hsr_forward.c
+++ b/net/hsr/hsr_forward.c
@@ -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
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-20 15:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17 14:55 [PATCH 1/2 v2] net: hsr: fix incorrect lsdu size in the tag of HSR frames for small frames Murali Karicheri
2020-07-17 14:55 ` [PATCH 2/2 v2] net: hsr: validate address B before copying to skb Murali Karicheri
2020-07-18  1:54   ` David Miller
2020-07-17 17:39 ` [PATCH 1/2 v2] net: hsr: fix incorrect lsdu size in the tag of HSR frames for small frames Grygorii Strashko
2020-07-20 14:08   ` Murali Karicheri
2020-07-20 15:25     ` Murali Karicheri
2020-07-18  1:54 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.