diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2017-03-01 20:48:39 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-02 14:35:31 -0800 |
commit | 9d6acb3bc9058d1fd7a5297d71f14213679bb4bd (patch) | |
tree | 39d335f1130b0b52e605abefd04e8b55b1546f0b | |
parent | be12502e2e64854dbe0a2ddff6d26ec1143d6890 (diff) | |
download | linux-9d6acb3bc9058d1fd7a5297d71f14213679bb4bd.tar.gz linux-9d6acb3bc9058d1fd7a5297d71f14213679bb4bd.tar.bz2 linux-9d6acb3bc9058d1fd7a5297d71f14213679bb4bd.zip |
ipv6: ignore null_entry in inet6_rtm_getroute() too
Like commit 1f17e2f2c8a8 ("net: ipv6: ignore null_entry on route dumps"),
we need to ignore null entry in inet6_rtm_getroute() too.
Return -ENETUNREACH here to sync with IPv4 behavior, as suggested by David.
Fixes: a1a22c1206 ("net: ipv6: Keep nexthop of multipath route on admin down")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv6/route.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 43ca90d50ae9..229bfcc451ef 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -3632,6 +3632,12 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh) rt = (struct rt6_info *)ip6_route_output(net, NULL, &fl6); } + if (rt == net->ipv6.ip6_null_entry) { + err = rt->dst.error; + ip6_rt_put(rt); + goto errout; + } + skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); if (!skb) { ip6_rt_put(rt); |