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

Next file: linux/net/ipv4/ip_alias.c
Previous file: linux/net/ipv4/af_inet.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.46/linux/net/ipv4/arp.c linux/net/ipv4/arp.c
@@ -96,6 +96,9 @@
 #include <net/netrom.h>
 #endif
 #endif
+#ifdef CONFIG_NET_ALIAS
+#include <linux/net_alias.h>
+#endif
 
 #include <asm/system.h>
 #include <asm/segment.h>
@@ -891,6 +894,19 @@
  *  cache.
  */
 
+/*
+ *	try to switch to alias device whose address is tip, if any
+ */
+
+#ifdef CONFIG_NET_ALIAS
+	if (net_alias_has(dev))
+	{
+		struct device *adev;
+		adev = net_alias_chk32(dev,AF_INET,tip,IFF_UP,IFF_NOARP);
+		if (adev != NULL) dev = adev;
+	}
+#endif
+
 	if (arp->ar_op == htons(ARPOP_REQUEST))
 	{ 
 /*
@@ -1019,7 +1035,15 @@
 		entry->timer.data = (unsigned long)entry;
 		memcpy(entry->ha, sha, dev->addr_len);
 		entry->last_updated = entry->last_used = jiffies;
+/*
+ *	make entry point to	'correct' device
+ */
+
+#ifdef CONFIG_NET_ALIAS
+		entry->dev = dev;
+#else
 		entry->dev = skb->dev;
+#endif
 		skb_queue_head_init(&entry->skb);
 		if (arp_lock == 1)
 		{

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this