linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: "Shiming Cheng (成诗明)" <Shiming.Cheng@mediatek.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"horms@kernel.org" <horms@kernel.org>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"edumazet@google.com" <edumazet@google.com>,
	"willemdebruijn.kernel@gmail.com"
	<willemdebruijn.kernel@gmail.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Lena Wang (王娜)" <Lena.Wang@mediatek.com>
Subject: Re: [PATCH net v2] ipv6: socket SO_BINDTODEVICE lookup routing fail without IPv6 rule.
Date: Sun, 19 Jan 2025 16:21:47 -0700	[thread overview]
Message-ID: <44d9b02c-becc-4578-ba06-d4d9fa77b493@kernel.org> (raw)
In-Reply-To: <5dbb7b8db7f4d31b620e5780e4716a9881252534.camel@mediatek.com>

On 1/13/25 8:11 PM, Shiming Cheng (成诗明) wrote:
> 
>   ip -6 -netns test1 rule add from all unreachable pri 1
>   ip -netns test1 rule add from all unreachable pri 1

The bug is in ipv4, ip_route_output_key_hash_rc():

   err = fib_lookup(net, fl4, res, 0);
   if (err) {
        res->fi = NULL;
        res->table = NULL;
        if (fl4->flowi4_oif &&
           (ipv4_is_multicast(fl4->daddr) || !fl4->flowi4_l3mdev)) {
...

The fib lookup should fail because of the unreachable rule, but the
output side is overlooking it for this legacy reason.

ip6_route_output_flags does not have this exception and so it is rightly
failing.



  reply	other threads:[~2025-01-19 23:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-03  5:43 [PATCH net v2] ipv6: socket SO_BINDTODEVICE lookup routing fail without IPv6 rule Shiming Cheng
2025-01-03 10:27 ` Shiming Cheng (成诗明)
2025-01-03 15:31   ` David Ahern
2025-01-14  3:11     ` Shiming Cheng (成诗明)
2025-01-19 23:21       ` David Ahern [this message]
2025-01-04  2:14 ` Jakub Kicinski

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=44d9b02c-becc-4578-ba06-d4d9fa77b493@kernel.org \
    --to=dsahern@kernel.org \
    --cc=Lena.Wang@mediatek.com \
    --cc=Shiming.Cheng@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemdebruijn.kernel@gmail.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).