Thread (6 messages) 6 messages, 3 authors, 2025-01-19

Re: [PATCH net v2] ipv6: socket SO_BINDTODEVICE lookup routing fail without IPv6 rule.

From: David Ahern <dsahern@kernel.org>
Date: 2025-01-19 23:21:49
Also in: linux-mediatek, lkml, netdev

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.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help