summaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorEric Dumazet2013-02-05 21:22:20 +0100
committerDavid S. Miller2013-02-06 21:59:47 +0100
commit6d1ccff627806829c46091bd9d9835302a3fbf5f (patch)
tree1caa7940d18321caa3973396ccd272230ddef604 /net/core/dev.c
parentnet: adjust skb_gso_segment() for calling in rx path (diff)
downloadkernel-qcow2-linux-6d1ccff627806829c46091bd9d9835302a3fbf5f.tar.gz
kernel-qcow2-linux-6d1ccff627806829c46091bd9d9835302a3fbf5f.tar.xz
kernel-qcow2-linux-6d1ccff627806829c46091bd9d9835302a3fbf5f.zip
net: reset mac header in dev_start_xmit()
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>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 65da698c500b..2f31bf97ba65 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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.
*/