Commit 8d7017fd authored by Mahesh Bandewar's avatar Mahesh Bandewar Committed by David S. Miller

blackhole_netdev: use blackhole_netdev to invalidate dst entries

Use blackhole_netdev instead of 'lo' device with lower MTU when marking
dst "dead".
Signed-off-by: default avatarMahesh Bandewar <maheshb@google.com>
Tested-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4de83b88
...@@ -160,7 +160,7 @@ void dst_dev_put(struct dst_entry *dst) ...@@ -160,7 +160,7 @@ void dst_dev_put(struct dst_entry *dst)
dst->ops->ifdown(dst, dev, true); dst->ops->ifdown(dst, dev, true);
dst->input = dst_discard; dst->input = dst_discard;
dst->output = dst_discard_out; dst->output = dst_discard_out;
dst->dev = dev_net(dst->dev)->loopback_dev; dst->dev = blackhole_netdev;
dev_hold(dst->dev); dev_hold(dst->dev);
dev_put(dev); dev_put(dev);
} }
......
...@@ -1532,7 +1532,6 @@ static void ipv4_dst_destroy(struct dst_entry *dst) ...@@ -1532,7 +1532,6 @@ static void ipv4_dst_destroy(struct dst_entry *dst)
void rt_flush_dev(struct net_device *dev) void rt_flush_dev(struct net_device *dev)
{ {
struct net *net = dev_net(dev);
struct rtable *rt; struct rtable *rt;
int cpu; int cpu;
...@@ -1543,7 +1542,7 @@ void rt_flush_dev(struct net_device *dev) ...@@ -1543,7 +1542,7 @@ void rt_flush_dev(struct net_device *dev)
list_for_each_entry(rt, &ul->head, rt_uncached) { list_for_each_entry(rt, &ul->head, rt_uncached) {
if (rt->dst.dev != dev) if (rt->dst.dev != dev)
continue; continue;
rt->dst.dev = net->loopback_dev; rt->dst.dev = blackhole_netdev;
dev_hold(rt->dst.dev); dev_hold(rt->dst.dev);
dev_put(dev); dev_put(dev);
} }
......
...@@ -176,7 +176,7 @@ static void rt6_uncached_list_flush_dev(struct net *net, struct net_device *dev) ...@@ -176,7 +176,7 @@ static void rt6_uncached_list_flush_dev(struct net *net, struct net_device *dev)
} }
if (rt_dev == dev) { if (rt_dev == dev) {
rt->dst.dev = loopback_dev; rt->dst.dev = blackhole_netdev;
dev_hold(rt->dst.dev); dev_hold(rt->dst.dev);
dev_put(rt_dev); dev_put(rt_dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment