spin_unlock(&dst_lock);
}
-static int dst_discard(struct sk_buff *skb)
+static int dst_discard_in(struct sk_buff *skb)
{
kfree_skb(skb);
return 0;
}
-static int dst_blackhole(struct sk_buff *skb)
+static int dst_discard_out(struct sk_buff **pskb)
{
- kfree_skb(skb);
+ kfree_skb(*pskb);
return 0;
}
dst->ops = ops;
dst->lastuse = jiffies;
dst->path = dst;
- dst->input = dst_discard;
- dst->output = dst_blackhole;
+ dst->input = dst_discard_in;
+ dst->output = dst_discard_out;
#if RT_CACHE_DEBUG >= 2
atomic_inc(&dst_total);
#endif
protocol module is unloaded.
*/
if (dst->dev == NULL || !(dst->dev->flags&IFF_UP)) {
- dst->input = dst_discard;
- dst->output = dst_blackhole;
+ dst->input = dst_discard_in;
+ dst->output = dst_discard_out;
}
dst->obsolete = 2;
}
_race_ _condition_.
*/
if (event!=NETDEV_DOWN &&
- dst->output == dst_blackhole) {
+ dst->output == dst_discard_out) {
dst->dev = &loopback_dev;
- dev_put(dev);
dev_hold(&loopback_dev);
- dst->output = dst_discard;
+ dev_put(dev);
+ dst->output = dst_discard_out;
if (dst->neighbour && dst->neighbour->dev == dev) {
dst->neighbour->dev = &loopback_dev;
dev_put(dev);
dev_hold(&loopback_dev);
}
} else {
- dst->input = dst_discard;
- dst->output = dst_blackhole;
+ dst->input = dst_discard_in;
+ dst->output = dst_discard_out;
}
+ if (dst->ops->ifdown)
+ dst->ops->ifdown(dst, event != NETDEV_DOWN);
}
}
spin_unlock_bh(&dst_lock);