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

From: Bryan Rittmeyer (bryan@ixiacom.com)
Date: Tue Aug 28 2001 - 19:51:19 EST


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:

--- net/ipv4/arp-orig.c Tue Aug 28 17:36:45 2001
+++ net/ipv4/arp.c Tue Aug 28 17:38:52 2001
@@ -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

-- 
Bryan Rittmeyer
mailto:bryan@ixiacom.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Aug 31 2001 - 21:00:32 EST