ipv4: Don't do expensive useless work during inetdev destroy.
[pandora-kernel.git] / net / ipv4 / fib_frontend.c
index 92fc5f6..76784c7 100644 (file)
@@ -764,6 +764,9 @@ void fib_del_ifaddr(struct in_ifaddr *ifa, struct in_ifaddr *iprim)
                subnet = 1;
        }
 
+       if (in_dev->dead)
+               goto no_promotions;
+
        /* Deletion is more complicated than add.
         * We should take care of not to delete too much :-)
         *
@@ -839,6 +842,7 @@ void fib_del_ifaddr(struct in_ifaddr *ifa, struct in_ifaddr *iprim)
                }
        }
 
+no_promotions:
        if (!(ok & BRD_OK))
                fib_magic(RTM_DELROUTE, RTN_BROADCAST, ifa->ifa_broadcast, 32, prim);
        if (subnet && ifa->ifa_prefixlen < 31) {