[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1360131740.28557.25.camel@edumazet-glaptop>
Date: Tue, 05 Feb 2013 22:22:20 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: netdev <netdev@...r.kernel.org>,
Ben Greear <greearb@...delatech.com>
Subject: [PATCH net-next 1/2] net: reset mac header in dev_start_xmit()
From: Eric Dumazet <edumazet@...gle.com>
On 64 bit arches :
There is a off-by-one error in qdisc_pkt_len_init() because
mac_header is not set in xmit path.
skb_mac_header() returns an out of bound value that was
harmless because hdr_len is an 'unsigned int'
On 32bit arches, the error is abysmal.
This patch is also a prereq for "macvlan: add multicast filter"
Signed-off-by: Eric Dumazet <edumazet@...gle.com>
Cc: Ben Greear <greearb@...delatech.com>
---
net/core/dev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/core/dev.c b/net/core/dev.c
index a87bc74..0b888b5 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2799,6 +2799,8 @@ int dev_queue_xmit(struct sk_buff *skb)
struct Qdisc *q;
int rc = -ENOMEM;
+ skb_reset_mac_header(skb);
+
/* Disable soft irqs for various locks below. Also
* stops preemption for RCU.
*/
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists