Skip to contentSkip to conversation

skb->dev set redundantly in net/ipv4/arp.c:arp_send()

PATCH Bryan Rittmeyer 1 participant 1 message Aug 29, 2001

lore
Share & tools
lore
#0 lore raw

Hello,

I think skb->dev is being set twice, for no purpose, in net/ipv4/arp.c:489 and net/ipv4/arp.c:563. The only external calls between these lines are memcpy and dev->hard_header, and neither of those will ever change skb->dev. So we can get rid of the redundant "skb->dev = dev" line right before dev_queue_xmit() unless I'm really stupid :-)

Anyway, here's my proposed patch against 2.4.9:

ipv4/arp.c Tue Aug 28 17:38:52 2001 renamed from ipv4/arp-orig.c Tue Aug 28 17:36:45 2001 +0 -1
@@ -560,7 +560,6 @@
                memset(arp_ptr, 0, dev->addr_len);
        arp_ptr+=dev->addr_len;
        memcpy(arp_ptr, &dest_ip, 4);
-       skb->dev = dev;
 
        dev_queue_xmit(skb);
        return;

Comments?

-Bryan

Signature · 2 lines
Bryan Rittmeyer
mailto:[email protected]