diff options
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r-- | net/core/netpoll.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index b3c559b9ac35..8a271285f2f3 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -330,6 +330,7 @@ static void arp_reply(struct sk_buff *skb) | |||
330 | unsigned char *arp_ptr; | 330 | unsigned char *arp_ptr; |
331 | int size, type = ARPOP_REPLY, ptype = ETH_P_ARP; | 331 | int size, type = ARPOP_REPLY, ptype = ETH_P_ARP; |
332 | __be32 sip, tip; | 332 | __be32 sip, tip; |
333 | unsigned char *sha; | ||
333 | struct sk_buff *send_skb; | 334 | struct sk_buff *send_skb; |
334 | struct netpoll *np = NULL; | 335 | struct netpoll *np = NULL; |
335 | 336 | ||
@@ -356,9 +357,14 @@ static void arp_reply(struct sk_buff *skb) | |||
356 | arp->ar_op != htons(ARPOP_REQUEST)) | 357 | arp->ar_op != htons(ARPOP_REQUEST)) |
357 | return; | 358 | return; |
358 | 359 | ||
359 | arp_ptr = (unsigned char *)(arp+1) + skb->dev->addr_len; | 360 | arp_ptr = (unsigned char *)(arp+1); |
361 | /* save the location of the src hw addr */ | ||
362 | sha = arp_ptr; | ||
363 | arp_ptr += skb->dev->addr_len; | ||
360 | memcpy(&sip, arp_ptr, 4); | 364 | memcpy(&sip, arp_ptr, 4); |
361 | arp_ptr += 4 + skb->dev->addr_len; | 365 | arp_ptr += 4; |
366 | /* if we actually cared about dst hw addr, it would get copied here */ | ||
367 | arp_ptr += skb->dev->addr_len; | ||
362 | memcpy(&tip, arp_ptr, 4); | 368 | memcpy(&tip, arp_ptr, 4); |
363 | 369 | ||
364 | /* Should we ignore arp? */ | 370 | /* Should we ignore arp? */ |
@@ -381,7 +387,7 @@ static void arp_reply(struct sk_buff *skb) | |||
381 | 387 | ||
382 | if (np->dev->hard_header && | 388 | if (np->dev->hard_header && |
383 | np->dev->hard_header(send_skb, skb->dev, ptype, | 389 | np->dev->hard_header(send_skb, skb->dev, ptype, |
384 | np->remote_mac, np->local_mac, | 390 | sha, np->local_mac, |
385 | send_skb->len) < 0) { | 391 | send_skb->len) < 0) { |
386 | kfree_skb(send_skb); | 392 | kfree_skb(send_skb); |
387 | return; | 393 | return; |
@@ -405,7 +411,7 @@ static void arp_reply(struct sk_buff *skb) | |||
405 | arp_ptr += np->dev->addr_len; | 411 | arp_ptr += np->dev->addr_len; |
406 | memcpy(arp_ptr, &tip, 4); | 412 | memcpy(arp_ptr, &tip, 4); |
407 | arp_ptr += 4; | 413 | arp_ptr += 4; |
408 | memcpy(arp_ptr, np->remote_mac, np->dev->addr_len); | 414 | memcpy(arp_ptr, sha, np->dev->addr_len); |
409 | arp_ptr += np->dev->addr_len; | 415 | arp_ptr += np->dev->addr_len; |
410 | memcpy(arp_ptr, &sip, 4); | 416 | memcpy(arp_ptr, &sip, 4); |
411 | 417 | ||