I've modified things as follows, when an arp reply is recieved (for
any IP address, not just my own), it checks if its in the arp table
already, and if so updates it. If it isn't it checks to see if the
reply is to my address and if so adds it to the table.
Its only a little patch, but I would appreciate it if it could go into
the next kernel.
Tim Morley
diff -u -r linux-1.3.80/net/ipv4/arp.c linux-1.3.80-arphack/net/ipv4/arp.c
--- linux-1.3.80/net/ipv4/arp.c Thu Apr 11 16:47:16 1996
+++ linux-1.3.80-arphack/net/ipv4/arp.c Thu Apr 11 17:30:29 1996
@@ -54,6 +54,8 @@
* Manuel Rodriguez: Gratutious ARP.
* Jonathan Layes : Added arpd support through kerneld
* message queue (960314)
+ * Tim Morley : Update arp table entries from arp
+ * replies to other hosts.
*/
/* RFC1122 Status:
@@ -1168,19 +1170,11 @@
}
/*
* It is now an arp reply.
- */
- if(ip_chk_addr(tip)!=IS_MYADDR)
- {
-/*
- * Replies to other machines get tossed.
- */
- kfree_skb(skb, FREE_READ);
- return 0;
- }
-/*
+ *
* Now all replies are handled. Next, anything that falls through to here
- * needs to be added to the arp cache, or have its entry updated if it is
- * there.
+ * needs to have its entry updated if it is there, and if the reply is to
+ * my adress add it to the tables. This allows up to keep ARP entries
+ * updated for any host we have already in the tables.
*/
arp_fast_lock();
@@ -1220,7 +1214,7 @@
arp_send_q(entry);
}
}
- else
+ else if (ip_chk_addr(tip)==IS_MYADDR)
{
/*
* No entry found. Need to add a new entry to the arp table.