patch-2.2.14 linux/net/ipv4/devinet.c

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

diff -u --recursive --new-file v2.2.13/linux/net/ipv4/devinet.c linux/net/ipv4/devinet.c
@@ -658,7 +658,7 @@
 			addr = ifa->ifa_local;
 	} endfor_ifa(in_dev);
 	
-	if (addr || scope >= RT_SCOPE_LINK)
+	if (addr)
 		return addr;
 
 	/* Not loopback addresses on loopback should be preferred
@@ -670,7 +670,9 @@
 			continue;
 
 		for_primary_ifa(in_dev) {
-			if (ifa->ifa_scope <= scope)
+			if (!IN_DEV_HIDDEN(in_dev) &&
+			    ifa->ifa_scope <= scope &&
+			    ifa->ifa_scope != RT_SCOPE_LINK)
 				return ifa->ifa_local;
 		} endfor_ifa(in_dev);
 	}
@@ -923,7 +925,7 @@
 static struct devinet_sysctl_table
 {
 	struct ctl_table_header *sysctl_header;
-	ctl_table devinet_vars[12];
+	ctl_table devinet_vars[13];
 	ctl_table devinet_dev[2];
 	ctl_table devinet_conf_dir[2];
 	ctl_table devinet_proto_dir[2];
@@ -962,6 +964,9 @@
          &proc_dointvec},
         {NET_IPV4_CONF_LOG_MARTIANS, "log_martians",
          &ipv4_devconf.log_martians, sizeof(int), 0644, NULL,
+         &proc_dointvec},
+	{NET_IPV4_CONF_HIDDEN, "hidden",
+         &ipv4_devconf.hidden, sizeof(int), 0644, NULL,
          &proc_dointvec},
 	 {0}},
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)