patch-2.1.88 linux/net/ipv4/arp.c

Next file: linux/net/ipv4/devinet.c
Previous file: linux/net/ipv4/Config.in
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.87/linux/net/ipv4/arp.c linux/net/ipv4/arp.c
@@ -899,7 +899,6 @@
 	int len=0;
 	off_t pos=0;
 	int size;
-	struct neighbour *n;
 	char hbuffer[HBUFFERLEN];
 	int i,j,k;
 	const char hexbuf[] =  "0123456789ABCDEF";
@@ -912,6 +911,7 @@
 	neigh_table_lock(&arp_tbl);
 
 	for(i=0; i<=NEIGH_HASHMASK; i++)	{
+		struct neighbour *n;
 		for (n=arp_tbl.hash_buckets[i]; n; n=n->next) {
 			struct device *dev = n->dev;
 			int hatype = dev->type;
@@ -957,6 +957,32 @@
 			size += sprintf(buffer+len+size,
 				 "     %-17s %s\n",
 				 "*", dev->name);
+
+			len += size;
+			pos += size;
+		  
+			if (pos <= offset)
+				len=0;
+			if (pos >= offset+length)
+				goto done;
+		}
+	}
+
+	for (i=0; i<=PNEIGH_HASHMASK; i++) {
+		struct pneigh_entry *n;
+		for (n=arp_tbl.phash_buckets[i]; n; n=n->next) {
+			struct device *dev = n->dev;
+			int hatype = dev ? dev->type : 0;
+
+			size = sprintf(buffer+len,
+				"%-17s0x%-10x0x%-10x%s",
+				in_ntoa(*(u32*)n->key),
+				hatype,
+				ATF_PUBL|ATF_PERM,       
+				"00:00:00:00:00:00");
+			size += sprintf(buffer+len+size,
+				 "     %-17s %s\n",
+				 "*", dev ? dev->name : "*");
 
 			len += size;
 			pos += size;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov