diff mbox

ipv6: fix ecmp lookup on forwarding path

Message ID 1371132295-5620-1-git-send-email-nicolas.dichtel@6wind.com
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

Nicolas Dichtel June 13, 2013, 2:04 p.m. UTC
From: dingzhi <zhi.ding@6wind.com>

There is no reason to skip ECMP lookup when oif is specified. For example, when
a packet is forwarded, the input interface is specified.

Signed-off-by: dingzhi <zhi.ding@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/ipv6/route.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Miller June 14, 2013, 12:38 a.m. UTC | #1
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Thu, 13 Jun 2013 16:04:55 +0200

> From: dingzhi <zhi.ding@6wind.com>
> 
> There is no reason to skip ECMP lookup when oif is specified. For example, when
> a packet is forwarded, the input interface is specified.
> 
> Signed-off-by: dingzhi <zhi.ding@6wind.com>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

There is no way this is valid.

The multipath code makes no attempt to choose a route that goes via
the interface that matches the one the user asked for in the flow key.

We must absolutely respect the OIF in the flow key during the route
lookup, this means no multipath until that code is changed to strictly
respect the OIF in the lookup key.

Otherwise what's the point of the OIF if you're going to pick a route
that doesn't match it?

I'm not apply this patch, sorry.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index ad0aa6b..9a6d637 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -742,7 +742,7 @@  static struct rt6_info *ip6_pol_route_lookup(struct net *net,
 restart:
 	rt = fn->leaf;
 	rt = rt6_device_match(net, rt, &fl6->saddr, fl6->flowi6_oif, flags);
-	if (rt->rt6i_nsiblings && fl6->flowi6_oif == 0)
+	if (rt->rt6i_nsiblings)
 		rt = rt6_multipath_select(rt, fl6);
 	BACKTRACK(net, &fl6->saddr);
 out:
@@ -875,7 +875,7 @@  restart_2:
 
 restart:
 	rt = rt6_select(fn, oif, strict | reachable);
-	if (rt->rt6i_nsiblings && oif == 0)
+	if (rt->rt6i_nsiblings)
 		rt = rt6_multipath_select(rt, fl6);
 	BACKTRACK(net, &fl6->saddr);
 	if (rt == net->ipv6.ip6_null_entry ||