Re: [PATCH] ipv6: socket SO_BINDTODEVICE lookup routing fail without IPv6 rule.
From: David Ahern
Date: Thu Jan 02 2025 - 10:57:28 EST
On 1/2/25 2:51 AM, shiming cheng wrote:
> When using socket IPv6 with SO_BINDTODEVICE, if IPv6 rule is not
> matched, it will return ENETUNREACH. In fact, IPv4 does not behave
> this way. IPv4 prioritizes looking up IP rules for routing and
> forwarding, if not matched it will use socket-bound out interface
> to send packets. The modification here is to make IPv6 behave the
> same as IPv4. If IP rule is not found, it will also use
> socket-bound out interface to send packts.
>
Please create test cases for IPv4 and IPv6 showing the problem - what
you are configuring and the expected result.
Also, commit messages should align with first column unless there is a
reason for an indentation.