Skip to content

Commit

Permalink
blackhole_netdev: use blackhole_netdev to invalidate dst entries
Browse files Browse the repository at this point in the history
Use blackhole_netdev instead of 'lo' device with lower MTU when marking
dst "dead".

Signed-off-by: Mahesh Bandewar <[email protected]>
Tested-by: Michael Chan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Mahesh Bandewar authored and davem330 committed Jul 2, 2019
1 parent 4de83b8 commit 8d7017f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion net/core/dst.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void dst_dev_put(struct dst_entry *dst)
dst->ops->ifdown(dst, dev, true);
dst->input = dst_discard;
dst->output = dst_discard_out;
dst->dev = dev_net(dst->dev)->loopback_dev;
dst->dev = blackhole_netdev;
dev_hold(dst->dev);
dev_put(dev);
}
Expand Down
3 changes: 1 addition & 2 deletions net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,6 @@ static void ipv4_dst_destroy(struct dst_entry *dst)

void rt_flush_dev(struct net_device *dev)
{
struct net *net = dev_net(dev);
struct rtable *rt;
int cpu;

Expand All @@ -1543,7 +1542,7 @@ void rt_flush_dev(struct net_device *dev)
list_for_each_entry(rt, &ul->head, rt_uncached) {
if (rt->dst.dev != dev)
continue;
rt->dst.dev = net->loopback_dev;
rt->dst.dev = blackhole_netdev;
dev_hold(rt->dst.dev);
dev_put(dev);
}
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ static void rt6_uncached_list_flush_dev(struct net *net, struct net_device *dev)
}

if (rt_dev == dev) {
rt->dst.dev = loopback_dev;
rt->dst.dev = blackhole_netdev;
dev_hold(rt->dst.dev);
dev_put(rt_dev);
}
Expand Down

0 comments on commit 8d7017f

Please sign in to comment.