]> err.no Git - linux-2.6/blobdiff - net/ipv4/devinet.c
[POWERPC] CPM: Rename commproc to cpm1 and cpm2_common.c to cpm2.c
[linux-2.6] / net / ipv4 / devinet.c
index affea9b121fc5288588486bd2c3b9e708f8e8b03..b42f74617bacfffaaf3af90856cc014ecf239dd5 100644 (file)
@@ -203,8 +203,6 @@ static void inetdev_destroy(struct in_device *in_dev)
        ASSERT_RTNL();
 
        dev = in_dev->dev;
-       if (dev == loopback_dev)
-               return;
 
        in_dev->dead = 1;
 
@@ -518,8 +516,6 @@ static struct in_ifaddr *rtm_to_ifaddr(struct nlmsghdr *nlh)
                goto errout;
        }
 
-       ipv4_devconf_setall(in_dev);
-
        ifa = inet_alloc_ifa();
        if (ifa == NULL) {
                /*
@@ -530,6 +526,7 @@ static struct in_ifaddr *rtm_to_ifaddr(struct nlmsghdr *nlh)
                goto errout;
        }
 
+       ipv4_devconf_setall(in_dev);
        in_dev_hold(in_dev);
 
        if (tb[IFA_ADDRESS] == NULL)
@@ -1030,7 +1027,7 @@ static void inetdev_changename(struct net_device *dev, struct in_device *in_dev)
                memcpy(ifa->ifa_label, dev->name, IFNAMSIZ);
                if (named++ == 0)
                        continue;
-               dot = strchr(ifa->ifa_label, ':');
+               dot = strchr(old, ':');
                if (dot == NULL) {
                        sprintf(old, ":%d", named);
                        dot = old;
@@ -1061,7 +1058,7 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
                        in_dev = inetdev_init(dev);
                        if (!in_dev)
                                return notifier_from_errno(-ENOMEM);
-                       if (dev == loopback_dev) {
+                       if (dev->flags & IFF_LOOPBACK) {
                                IN_DEV_CONF_SET(in_dev, NOXFRM, 1);
                                IN_DEV_CONF_SET(in_dev, NOPOLICY, 1);
                        }
@@ -1077,7 +1074,7 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
        case NETDEV_UP:
                if (dev->mtu < 68)
                        break;
-               if (dev == loopback_dev) {
+               if (dev->flags & IFF_LOOPBACK) {
                        struct in_ifaddr *ifa;
                        if ((ifa = inet_alloc_ifa()) != NULL) {
                                ifa->ifa_local =