Skip to contentSkip to conversation

rt2x00: Fix trimming of L2 padded frames.

PATCH In review Gertjan van Wingerde 2 participants 2 messages Dec 4, 2009 – Dec 5, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt2x00: Fix trimming of L2 padded frames.

Ensure that frames without payload are properly trimmed in rt2x00queue_insert_l2pad.

This should fix the bug reported by Benoit Papillault in:
http://marc.info/?l=linux-wireless&m=125974773006734&w=2

---
 drivers/net/wireless/rt2x00/rt2x00queue.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2x00queue.c +1 -1
index 7452fa8..3d8fb68 100644
@@ -180,7 +180,7 @@ void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length)
 	unsigned int payload_length = skb->len - header_length;
 	unsigned int header_align = ALIGN_SIZE(skb, 0);
 	unsigned int payload_align = ALIGN_SIZE(skb, header_length);
-	unsigned int l2pad = L2PAD_SIZE(header_length);
+	unsigned int l2pad = payload_length ? L2PAD_SIZE(header_length) : 0;
 
 	/*
 	 * Adjust the header alignment if the payload needs to be moved more
Signature · 1 line
1.6.5.3
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Gertjan van Wingerde

Ensure that frames without payload are properly trimmed in rt2x00queue_insert_l2pad.

This should fix the bug reported by Benoit Papillault in:
http://marc.info/?l=linux-wireless&m=125974773006734&w=2

Quoted 17 lines
---
 drivers/net/wireless/rt2x00/rt2x00queue.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2x00queue.c +1 -1
index 7452fa8..3d8fb68 100644
@@ -180,7 +180,7 @@ void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length)
 	unsigned int payload_length = skb->len - header_length;
 	unsigned int header_align = ALIGN_SIZE(skb, 0);
 	unsigned int payload_align = ALIGN_SIZE(skb, header_length);
-	unsigned int l2pad = L2PAD_SIZE(header_length);
+	unsigned int l2pad = payload_length ? L2PAD_SIZE(header_length) : 0;
 
 	/*
 	 * Adjust the header alignment if the payload needs to be moved more