Subject: Re: [Patch net v3 2/2] selftests: add a test case for rp_filter

From: Peilin Ye <[email-masked]>
Date: Sun, 28 Nov 2021 22:40:56 -0800

Hi all,

On Wed, Nov 24, 2021 at 09:43:08AM +0800, Hangbin Liu wrote:
> On Tue, Nov 23, 2021 at 05:05:14PM -0800, Cong Wang wrote:
> > My colleague Peilin is now looking into this.
> 
> Thanks Wang Cong and Peilin. Sorry I didn't get time to check on this
> issue.

I think I figured out the cause:

There was a bug [1] in ping's -I option, which has been fixed by iputils
commit f455fee41c07 ("ping: also bind the ICMP socket to the specific
device") [2] in 2016.

Before the fix, "ping -I" actually did _not_ bind the ICMP message
socket to device.  It only bound the "probe socket"; see "probe_fd" in
ping4_run().

Now, "ping -I" binds both sockets to device using SO_BINDTODEVICE, and
socket lookup is failing (when receiving ICMP_ECHOREPLY messages) for
our rp_filter test here, as David mentioned earlier.

I'm still thinking about how should we fix the test.  Any ideas?

[1] https://github.com/iputils/iputils/issues/55
[2] https://github.com/iputils/iputils/commit/f455fee41c077d4b700a473b2f5b3487b8febc1d

Thanks,
Peilin Ye