diff mbox

Forcing the output interface using ip6_route_output doesn't work

Message ID 5605B8DF.2070603@cumulusnetworks.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

David Ahern Sept. 25, 2015, 9:13 p.m. UTC
On 9/25/15 7:56 AM, Wolfgang Nothdurft wrote:
> It seems that the ip6_route_output(net, sk, fl6) kernel function ignores
> the fl6.flowi6_oif parameter for the routing decision.

It is considered, but a mismatch is not considered fatal.

I think the attached should fix your problem.

Comments

Wolfgang Nothdurft Sept. 26, 2015, 3:51 p.m. UTC | #1
Am 25.09.2015 um 23:13 schrieb David Ahern:
> On 9/25/15 7:56 AM, Wolfgang Nothdurft wrote:
>> It seems that the ip6_route_output(net, sk, fl6) kernel function ignores
>> the fl6.flowi6_oif parameter for the routing decision.
>
> It is considered, but a mismatch is not considered fatal.
>
> I think the attached should fix your problem.
>
>

Thanks, now it works as expected. :)

Wolfgang
--
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 118f8fa1a809..cc52458f7226 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1169,7 +1169,8 @@  struct dst_entry *ip6_route_output(struct net *net, const struct sock *sk,
 
 	fl6->flowi6_iif = LOOPBACK_IFINDEX;
 
-	if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl6->daddr))
+	if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl6->daddr) ||
+	     fl6->flowi6_oif)
 		flags |= RT6_LOOKUP_F_IFACE;
 
 	if (!ipv6_addr_any(&fl6->saddr))