All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsa@cumulusnetworks.com>
To: Wolfgang Nothdurft <netdev@linux-dude.de>, netdev@vger.kernel.org
Subject: Re: Forcing the output interface using ip6_route_output doesn't work
Date: Fri, 25 Sep 2015 15:13:03 -0600	[thread overview]
Message-ID: <5605B8DF.2070603@cumulusnetworks.com> (raw)
In-Reply-To: <560552A7.40305@linux-dude.de>

[-- Attachment #1: Type: text/plain, Size: 286 bytes --]

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.



[-- Attachment #2: ip6-rt-get-with-oif.patch --]
[-- Type: text/plain, Size: 503 bytes --]

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))

  reply	other threads:[~2015-09-25 21:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25 13:56 Forcing the output interface using ip6_route_output doesn't work Wolfgang Nothdurft
2015-09-25 21:13 ` David Ahern [this message]
2015-09-26 15:51   ` Wolfgang Nothdurft

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5605B8DF.2070603@cumulusnetworks.com \
    --to=dsa@cumulusnetworks.com \
    --cc=netdev@linux-dude.de \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.