[1041] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Permanent ARP entries broken ?

daemon@ATHENA.MIT.EDU (Craig Schlenter)
Mon Sep 4 18:41:56 1995

Date: Mon, 4 Sep 1995 10:10:25 +0200 (GMT+0200)
From: Craig Schlenter <schz@kidd.co.za>
To: linux-net@vger.rutgers.edu

Hi

Should permanent entries in the ARP cache be changed by incoming arp requests
? Currently arp.c overwrites the existing entry. The patch below fixes the
problem ... 

If the current behaviour is considered 'correct', could we add another 
entry type, say VERY_PERMANENT, that will not be overwritten ?

If there are no complaints, I'll submit this for 1.3.24.

Thank you,

--Craig Schlenter
cschle@paradigm.co.za <- preferred
schz@kidd.co.za

--- v1.3.22/net/ipv4/arp.c	Fri Sep  1 19:50:01 1995
+++ linux/net/ipv4/arp.c	Sat Sep  2 17:00:52 1995
@@ -42,7 +42,9 @@
  *		Mike Shaver     :       RFC1122 checks.
  *		Jonathan Naylor :	Only lookup the hardware address for
  *					the correct hardware type.
- *		Germano Caronni	:	Assorted subtle races
+ *		Germano Caronni	:	Assorted subtle races.
+ *		Craig Schlenter :	Don't modify permanent entry 
+ *					during arp_rcv.
  */
 
 /* RFC1122 Status:
@@ -93,9 +95,9 @@
 
 /*
  *	This structure defines the ARP mapping cache. As long as we make changes
- *	in this structure, we keep interrupts of. But normally we can copy the
- *	hardware address and the device pointer in a local variable and then make
- *	any "long calls" to send a packet out.
+ *	in this structure, we keep interrupts off. But normally we can copy the
+ *	hardware address and the device pointer in a local variable and then 
+ *	make any "long calls" to send a packet out.
  */
 
 struct arp_table
@@ -811,11 +813,13 @@
 	if(entry)
 	{
 /*
- *	Entry found; update it.
+ *	Entry found; update it only if it is not a permanent entry.
  */
-		memcpy(entry->ha, sha, hlen);
-		entry->hlen = hlen;
-		entry->last_used = jiffies;
+		if (!(entry->flags & ATF_PERM)) {
+			memcpy(entry->ha, sha, hlen);
+			entry->hlen = hlen;
+			entry->last_used = jiffies;
+		}
 		if (!(entry->flags & ATF_COM))
 		{
 /*



home help back first fref pref prev next nref lref last post