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

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

diff -u --recursive --new-file v2.1.21/linux/net/ipv4/devinet.c linux/net/ipv4/devinet.c
@@ -43,9 +43,7 @@
 #include <net/sock.h>
 #include <net/arp.h>
 #include <linux/notifier.h>
-#ifdef CONFIG_NET_ALIAS
 #include <linux/net_alias.h>
-#endif
 #ifdef CONFIG_KERNELD
 #include <linux/kerneld.h>
 #endif
@@ -56,7 +54,7 @@
  *	Determine a default network mask, based on the IP address. 
  */
 
-unsigned long ip_get_mask(unsigned long addr)
+static unsigned long ip_get_mask(unsigned long addr)
 {
   	unsigned long dst;
 
@@ -78,19 +76,6 @@
   	return(0);
 }
 
-struct device *dev_getbyhwaddr(unsigned short type, char *ha)
-{
-	struct device *dev;
-
-	for (dev = dev_base; dev != NULL; dev = dev->next) 
-	{
-		if (dev->type == type &&
-		    !(dev->flags&(IFF_LOOPBACK|IFF_NOARP)) &&
-		    memcmp(dev->dev_addr, ha, dev->addr_len) == 0)
-			return(dev);
-	}
-	return(NULL);
-}
 
 /*
  *	This checks bitmasks for the ioctl calls for devices.
@@ -180,9 +165,13 @@
 			
 			if(ifr.ifr_addr.sa_family==AF_UNSPEC)
 			{
+				int ret;
 				if(dev->set_mac_address==NULL)
 					return -EOPNOTSUPP;
-				return dev->set_mac_address(dev,&ifr.ifr_addr);
+				ret = dev->set_mac_address(dev,&ifr.ifr_addr);
+				if (!ret)
+					notifier_call_chain(&netdev_chain, NETDEV_CHANGEADDR, dev);
+				return ret;
 			}
 			if(ifr.ifr_addr.sa_family!=AF_INET)
 				return -EINVAL;

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