netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: netdev@vger.kernel.org, Stefano Brivio <sbrivio@redhat.com>,
	Marcelo Ricardo Leitner <mleitner@redhat.com>,
	"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH net] ipv4/route: do not check saddr dev if iif is LOOPBACK_IFINDEX
Date: Thu, 1 Aug 2019 22:16:00 -0600	[thread overview]
Message-ID: <209d2ebf-aeb1-de08-2343-f478d51b92fa@gmail.com> (raw)
In-Reply-To: <20190802041358.GT18865@dhcp-12-139.nay.redhat.com>

On 8/1/19 10:13 PM, Hangbin Liu wrote:
> On Thu, Aug 01, 2019 at 01:51:25PM -0600, David Ahern wrote:
>> On 8/1/19 2:29 AM, Hangbin Liu wrote:
>>> Jianlin reported a bug that for IPv4, ip route get from src_addr would fail
>>> if src_addr is not an address on local system.
>>>
>>> \# ip route get 1.1.1.1 from 2.2.2.2
>>> RTNETLINK answers: Invalid argument
>>
>> so this is a forwarding lookup in which case iif should be set. Based on
> 
> with out setting iif in userspace, the kernel set iif to lo by default.

right, it presumes locally generated traffic.
> 
>> the above 'route get' inet_rtm_getroute is doing a lookup as if it is
>> locally generated traffic.
> 
> yeah... but what about the IPv6 part. That cause a different behavior in
> userspace.

just one of many, many annoying differences between v4 and v6. We could
try to catalog it.

  reply	other threads:[~2019-08-02  4:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01  8:29 [PATCH net] ipv4/route: do not check saddr dev if iif is LOOPBACK_IFINDEX Hangbin Liu
2019-08-01 19:51 ` David Ahern
2019-08-02  4:13   ` Hangbin Liu
2019-08-02  4:16     ` David Ahern [this message]
2019-08-12  3:49       ` David Miller
2019-08-12 22:58         ` Stefano Brivio
2019-08-13  0:23           ` David Ahern
2019-08-02 20:35   ` Stefano Brivio

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=209d2ebf-aeb1-de08-2343-f478d51b92fa@gmail.com \
    --to=dsahern@gmail.com \
    --cc=davem@davemloft.net \
    --cc=liuhangbin@gmail.com \
    --cc=mleitner@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=sbrivio@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).