* [PATCH net] ipv6: Do not consider linkdown nexthops during multipath
@ 2017-11-21 7:50 Ido Schimmel
2017-11-21 19:00 ` David Ahern
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Ido Schimmel @ 2017-11-21 7:50 UTC (permalink / raw)
To: netdev; +Cc: davem, dsahern, andy, mlxsw, Ido Schimmel
When the 'ignore_routes_with_linkdown' sysctl is set, we should not
consider linkdown nexthops during route lookup.
While the code correctly verifies that the initially selected route
('match') has a carrier, it does not perform the same check in the
subsequent multipath selection, resulting in a potential packet loss.
In case the chosen route does not have a carrier and the sysctl is set,
choose the initially selected route.
Fixes: 35103d11173b ("net: ipv6 sysctl option to ignore routes when nexthop link is down")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
net/ipv6/route.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 05eb7bc36156..0363db914c7a 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -472,6 +472,11 @@ static struct rt6_info *rt6_multipath_select(struct rt6_info *match,
&match->rt6i_siblings, rt6i_siblings) {
route_choosen--;
if (route_choosen == 0) {
+ struct inet6_dev *idev = sibling->rt6i_idev;
+
+ if (!netif_carrier_ok(sibling->dst.dev) &&
+ idev->cnf.ignore_routes_with_linkdown)
+ break;
if (rt6_score_route(sibling, oif, strict) < 0)
break;
match = sibling;
--
2.14.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] ipv6: Do not consider linkdown nexthops during multipath
2017-11-21 7:50 [PATCH net] ipv6: Do not consider linkdown nexthops during multipath Ido Schimmel
@ 2017-11-21 19:00 ` David Ahern
2017-11-21 19:11 ` Andy Gospodarek
2017-11-23 16:27 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Ahern @ 2017-11-21 19:00 UTC (permalink / raw)
To: Ido Schimmel, netdev; +Cc: davem, andy, mlxsw
On 11/21/17 12:50 AM, Ido Schimmel wrote:
> When the 'ignore_routes_with_linkdown' sysctl is set, we should not
> consider linkdown nexthops during route lookup.
>
> While the code correctly verifies that the initially selected route
> ('match') has a carrier, it does not perform the same check in the
> subsequent multipath selection, resulting in a potential packet loss.
>
> In case the chosen route does not have a carrier and the sysctl is set,
> choose the initially selected route.
>
> Fixes: 35103d11173b ("net: ipv6 sysctl option to ignore routes when nexthop link is down")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> ---
> net/ipv6/route.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 05eb7bc36156..0363db914c7a 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -472,6 +472,11 @@ static struct rt6_info *rt6_multipath_select(struct rt6_info *match,
> &match->rt6i_siblings, rt6i_siblings) {
> route_choosen--;
> if (route_choosen == 0) {
> + struct inet6_dev *idev = sibling->rt6i_idev;
> +
> + if (!netif_carrier_ok(sibling->dst.dev) &&
> + idev->cnf.ignore_routes_with_linkdown)
> + break;
> if (rt6_score_route(sibling, oif, strict) < 0)
> break;
> match = sibling;
>
Looks right to me.
Acked-by: David Ahern <dsahern@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] ipv6: Do not consider linkdown nexthops during multipath
2017-11-21 7:50 [PATCH net] ipv6: Do not consider linkdown nexthops during multipath Ido Schimmel
2017-11-21 19:00 ` David Ahern
@ 2017-11-21 19:11 ` Andy Gospodarek
2017-11-23 16:27 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Andy Gospodarek @ 2017-11-21 19:11 UTC (permalink / raw)
To: Ido Schimmel; +Cc: netdev, davem, dsahern, mlxsw
On Tue, Nov 21, 2017 at 09:50:12AM +0200, Ido Schimmel wrote:
> When the 'ignore_routes_with_linkdown' sysctl is set, we should not
> consider linkdown nexthops during route lookup.
>
> While the code correctly verifies that the initially selected route
> ('match') has a carrier, it does not perform the same check in the
> subsequent multipath selection, resulting in a potential packet loss.
>
> In case the chosen route does not have a carrier and the sysctl is set,
> choose the initially selected route.
>
> Fixes: 35103d11173b ("net: ipv6 sysctl option to ignore routes when nexthop link is down")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Nice find. Looks good to me, as well.
Acked-by: Andy Gospodarek <andy@greyhouse.net>
> ---
> net/ipv6/route.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 05eb7bc36156..0363db914c7a 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -472,6 +472,11 @@ static struct rt6_info *rt6_multipath_select(struct rt6_info *match,
> &match->rt6i_siblings, rt6i_siblings) {
> route_choosen--;
> if (route_choosen == 0) {
> + struct inet6_dev *idev = sibling->rt6i_idev;
> +
> + if (!netif_carrier_ok(sibling->dst.dev) &&
> + idev->cnf.ignore_routes_with_linkdown)
> + break;
> if (rt6_score_route(sibling, oif, strict) < 0)
> break;
> match = sibling;
> --
> 2.14.3
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] ipv6: Do not consider linkdown nexthops during multipath
2017-11-21 7:50 [PATCH net] ipv6: Do not consider linkdown nexthops during multipath Ido Schimmel
2017-11-21 19:00 ` David Ahern
2017-11-21 19:11 ` Andy Gospodarek
@ 2017-11-23 16:27 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-11-23 16:27 UTC (permalink / raw)
To: idosch; +Cc: netdev, dsahern, andy, mlxsw
From: Ido Schimmel <idosch@mellanox.com>
Date: Tue, 21 Nov 2017 09:50:12 +0200
> When the 'ignore_routes_with_linkdown' sysctl is set, we should not
> consider linkdown nexthops during route lookup.
>
> While the code correctly verifies that the initially selected route
> ('match') has a carrier, it does not perform the same check in the
> subsequent multipath selection, resulting in a potential packet loss.
>
> In case the chosen route does not have a carrier and the sysctl is set,
> choose the initially selected route.
>
> Fixes: 35103d11173b ("net: ipv6 sysctl option to ignore routes when nexthop link is down")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-11-23 16:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-21 7:50 [PATCH net] ipv6: Do not consider linkdown nexthops during multipath Ido Schimmel
2017-11-21 19:00 ` David Ahern
2017-11-21 19:11 ` Andy Gospodarek
2017-11-23 16:27 ` 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.