linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qiao Ma <mqaio@linux.alibaba.com>
To: linux-kselftest@vger.kernel.org
Cc: shuah@kernel.org
Subject: [PATCH] selftests: fix rp_filter testcase failure bug
Date: Thu, 15 Apr 2021 20:23:34 +0800	[thread overview]
Message-ID: <ffde0a9716e7cf89b562f9b1cdcdd9fd1081f4d0.1618489078.git.mqaio@linux.alibaba.com> (raw)

The rp_filter testcase is used to test whether local packets redirected
from dummy1 to lo could pass the checking of rp_filter.

In fact, the packets passed the checking, but the testing process cannot
receive any reply packets, leading to test failure. The reason is that
the device dummy1 lacks ip address, caused the incorrect routing of
reply packets.

This patch adds ip address for dummy1 device.

Signed-off-by: Qiao Ma <mqaio@linux.alibaba.com>
---
 tools/testing/selftests/net/fib_tests.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh
index 2b5707738609..9a843ca0b913 100755
--- a/tools/testing/selftests/net/fib_tests.sh
+++ b/tools/testing/selftests/net/fib_tests.sh
@@ -448,6 +448,7 @@ fib_rp_filter_test()
 	$IP link set dummy0 address 52:54:00:6a:c7:5e
 	$IP link add dummy1 type dummy
 	$IP link set dummy1 address 52:54:00:6a:c7:5e
+	$IP address add 198.51.101.1/24 dev dummy1
 	$IP link set dev dummy1 up
 	$NS_EXEC sysctl -qw net.ipv4.conf.all.rp_filter=1
 	$NS_EXEC sysctl -qw net.ipv4.conf.all.accept_local=1
-- 
2.18.2


                 reply	other threads:[~2021-04-15 12:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=ffde0a9716e7cf89b562f9b1cdcdd9fd1081f4d0.1618489078.git.mqaio@linux.alibaba.com \
    --to=mqaio@linux.alibaba.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    /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).