From: Yun Lu <luyun_611@163.com>
To: willemb@google.com, davem@davemloft.net, edumazet@google.com
Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: [PATCH] selftests/net: enable lo.accept_local in psock_snd test
Date: Fri, 20 May 2022 14:38:35 +0800 [thread overview]
Message-ID: <20220520063835.866445-1-luyun_611@163.com> (raw)
From: luyun <luyun@kylinos.cn>
The psock_snd test sends and recievs packets over loopback, but the
parameter lo.accept_local is disabled by default, this test will
fail with Resource temporarily unavailable:
sudo ./psock_snd.sh
dgram
tx: 128
rx: 142
./psock_snd: recv: Resource temporarily unavailable
So enable the parameter lo.accept_local in psock_snd test.
Signed-off-by: luyun <luyun@kylinos.cn>
Reviewed-by: Jackie Liu <liuyun01@kylinos.cn>
---
tools/testing/selftests/net/psock_snd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/net/psock_snd.c b/tools/testing/selftests/net/psock_snd.c
index 7d15e10a9fb6..edf1e6f80d41 100644
--- a/tools/testing/selftests/net/psock_snd.c
+++ b/tools/testing/selftests/net/psock_snd.c
@@ -389,6 +389,8 @@ int main(int argc, char **argv)
error(1, errno, "ip link set mtu");
if (system("ip addr add dev lo 172.17.0.1/24"))
error(1, errno, "ip addr add");
+ if (system("sysctl -w net.ipv4.conf.lo.accept_local=1"))
+ error(1, errno, "sysctl lo.accept_local");
run_test();
--
2.25.1
No virus found
Checked by Hillstone Network AntiVirus
next reply other threads:[~2022-05-20 6:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-20 6:38 Yun Lu [this message]
2022-05-20 13:52 ` [PATCH] selftests/net: enable lo.accept_local in psock_snd test Willem de Bruijn
2022-05-23 9:19 ` Yun Lu
2022-05-23 13:32 ` Willem de Bruijn
2022-05-24 10:03 ` Yun Lu
2022-05-24 13:33 ` Willem de Bruijn
2022-05-25 1:48 ` Yun Lu
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=20220520063835.866445-1-luyun_611@163.com \
--to=luyun_611@163.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=willemb@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.