summaryrefslogtreecommitdiff
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
authorWei Wang <weiwan@google.com>2017-06-17 20:42:26 +0300
committerDavid S. Miller <davem@davemloft.net>2017-06-18 05:53:59 +0300
commit1dbe32525e26ec28d2cc17f65a90fc7b53f1f8d0 (patch)
treec8de21d5e5503a6cf665c658b012c6d28c1345dc /net/ipv4/route.c
parentd24406c85d123df773bc4df88ad5da2233896919 (diff)
downloadlinux-1dbe32525e26ec28d2cc17f65a90fc7b53f1f8d0.tar.xz
net: use loopback dev when generating blackhole route
Existing ipv4/6_blackhole_route() code generates a blackhole route with dst->dev pointing to the passed in dst->dev. It is not necessary to hold reference to the passed in dst->dev because the packets going through this route are dropped anyway. A loopback interface is good enough so that we don't need to worry about releasing this dst->dev when this dev is going down. Signed-off-by: Wei Wang <weiwan@google.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 9b38cf18144e..0a843ef2b709 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2504,7 +2504,7 @@ struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_or
new->input = dst_discard;
new->output = dst_discard_out;
- new->dev = ort->dst.dev;
+ new->dev = net->loopback_dev;
if (new->dev)
dev_hold(new->dev);