* [Patch net v2] ipv6: ignore null_entry in inet6_rtm_getroute() too
@ 2017-03-02 4:48 Cong Wang
2017-03-02 5:05 ` David Ahern
2017-03-02 22:36 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Cong Wang @ 2017-03-02 4:48 UTC (permalink / raw)
To: netdev; +Cc: dvyukov, Cong Wang, David Ahern
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>
---
net/ipv6/route.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index f54f426..df757b2 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -3627,6 +3627,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);
--
2.5.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Patch net v2] ipv6: ignore null_entry in inet6_rtm_getroute() too
2017-03-02 4:48 [Patch net v2] ipv6: ignore null_entry in inet6_rtm_getroute() too Cong Wang
@ 2017-03-02 5:05 ` David Ahern
2017-03-02 22:36 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Ahern @ 2017-03-02 5:05 UTC (permalink / raw)
To: Cong Wang, netdev; +Cc: dvyukov
On 3/1/17 8:48 PM, Cong Wang wrote:
> 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>
> ---
> net/ipv6/route.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch net v2] ipv6: ignore null_entry in inet6_rtm_getroute() too
2017-03-02 4:48 [Patch net v2] ipv6: ignore null_entry in inet6_rtm_getroute() too Cong Wang
2017-03-02 5:05 ` David Ahern
@ 2017-03-02 22:36 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-03-02 22:36 UTC (permalink / raw)
To: xiyou.wangcong; +Cc: netdev, dvyukov, dsa
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Wed, 1 Mar 2017 20:48:39 -0800
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-02 23:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-02 4:48 [Patch net v2] ipv6: ignore null_entry in inet6_rtm_getroute() too Cong Wang
2017-03-02 5:05 ` David Ahern
2017-03-02 22:36 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.