]> Pileus Git - ~andy/linux/blobdiff - net/core/dst.c
[NETNS]: DST cleanup routines should be called inside namespace.
[~andy/linux] / net / core / dst.c
index 5c6cfc4e7fdbe2bcaf393b9e1692834cfe3c0b74..3a01a819ba478112168e4a3c2db3b3ac023b8e67 100644 (file)
@@ -165,7 +165,7 @@ void * dst_alloc(struct dst_ops * ops)
        struct dst_entry * dst;
 
        if (ops->gc && atomic_read(&ops->entries) > ops->gc_thresh) {
-               if (ops->gc())
+               if (ops->gc(ops))
                        return NULL;
        }
        dst = kmem_cache_zalloc(ops->kmem_cachep, GFP_ATOMIC);
@@ -284,8 +284,8 @@ static inline void dst_ifdown(struct dst_entry *dst, struct net_device *dev,
                dev_put(dev);
                if (dst->neighbour && dst->neighbour->dev == dev) {
                        dst->neighbour->dev = dst->dev;
+                       dev_hold(dst->dev);
                        dev_put(dev);
-                       dev_hold(dst->neighbour->dev);
                }
        }
 }
@@ -295,9 +295,6 @@ static int dst_dev_event(struct notifier_block *this, unsigned long event, void
        struct net_device *dev = ptr;
        struct dst_entry *dst, *last = NULL;
 
-       if (dev->nd_net != &init_net)
-               return NOTIFY_DONE;
-
        switch (event) {
        case NETDEV_UNREGISTER:
        case NETDEV_DOWN: