[NETNS][DST] dst: pass the dst_ops as parameter to the gc functions
[safe/jmp/linux-2.6] / net / core / dst.c
index 5c6cfc4..7deef48 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);
                }
        }
 }