patch-2.1.10 linux/net/ipv6/addrconf.c

Next file: linux/net/ipv6/af_inet6.c
Previous file: linux/net/ipv6/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.9/linux/net/ipv6/addrconf.c linux/net/ipv6/addrconf.c
@@ -774,7 +774,7 @@
 
 }
 
-static void addrconf_ifdown(struct device *dev)
+static int addrconf_ifdown(struct device *dev)
 {
 	struct inet6_dev *idev, **bidev;
 	struct inet6_ifaddr *ifa, **bifa;
@@ -796,8 +796,9 @@
 
 	if (idev == NULL)
 	{
-		printk(KERN_DEBUG "addrconf_ifdown: device not found\n"); 
-		return;
+		printk(KERN_DEBUG "addrconf_ifdown: device not found\n");
+		end_bh_atomic();
+		return -ENODEV;
 	}
 	
 	/*
@@ -828,6 +829,7 @@
 
 	kfree(idev);
 	end_bh_atomic();
+	return 0;
 }
 
 /*
@@ -1024,9 +1026,12 @@
 		 *	Remove all addresses from this interface
 		 *	and take the interface out of the list.
 		 */
-		addrconf_ifdown(dev);
-		rt6_ifdown(dev);
-		rt6_sndmsg(RTMSG_NEWDEVICE, NULL, NULL, 0, 0, dev->name, 0);
+		if (addrconf_ifdown(dev) == 0)
+		{
+			rt6_ifdown(dev);
+			rt6_sndmsg(RTMSG_NEWDEVICE, NULL, NULL, 0, 0,
+				   dev->name, 0);
+		}
 
 		break;
 	}

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