Commit 9d6acb3b authored by WANG Cong's avatar WANG Cong Committed by David S. Miller

ipv6: ignore null_entry in inet6_rtm_getroute() too

Like commit 1f17e2f2 ("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: a1a22c12 ("net: ipv6: Keep nexthop of multipath route on admin down")
Reported-by: default avatarDmitry Vyukov <[email protected]>
Cc: David Ahern <[email protected]>
Signed-off-by: default avatarCong Wang <[email protected]>
Acked-by: default avatarDavid Ahern <[email protected]>
Signed-off-by: default avatarDavid S. Miller <[email protected]>
parent be12502e
......@@ -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);
......
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