]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net: reset mac header in dev_start_xmit()
authorEric Dumazet <edumazet@google.com>
Tue, 5 Feb 2013 20:22:20 +0000 (20:22 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Feb 2013 20:59:47 +0000 (15:59 -0500)
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@google.com>
Cc: Ben Greear <greearb@candelatech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index 65da698c500bc4f0d468af7d2eb5c7e30a3894d0..2f31bf97ba6572f719038bc76aeb57627f2d2fee 100644 (file)
@@ -2835,6 +2835,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.
         */