Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b46f0afa authored by David Ahern's avatar David Ahern Committed by Greg Kroah-Hartman
Browse files

selftests: Fix raw socket bind tests with VRF



[ Upstream commit 0f108ae4452025fef529671998f6c7f1c4526790 ]

Commit referenced below added negative socket bind tests for VRF. The
socket binds should fail since the address to bind to is in a VRF yet
the socket is not bound to the VRF or a device within it. Update the
expected return code to check for 1 (bind failure) so the test passes
when the bind fails as expected. Add a 'show_hint' comment to explain
why the bind is expected to fail.

Fixes: 75b2b2b3 ("selftests: Add ipv4 address bind tests to fcnal-test")
Reported-by: default avatarLi Zhijian <lizhijian@fujitsu.com>
Signed-off-by: default avatarDavid Ahern <dsahern@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 7b5596e5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1491,8 +1491,9 @@ ipv4_addr_bind_vrf()
	for a in ${NSA_IP} ${VRF_IP}
	do
		log_start
		show_hint "Socket not bound to VRF, but address is in VRF"
		run_cmd nettest -s -R -P icmp -l ${a} -b
		log_test_addr ${a} $? 0 "Raw socket bind to local address"
		log_test_addr ${a} $? 1 "Raw socket bind to local address"

		log_start
		run_cmd nettest -s -R -P icmp -l ${a} -d ${NSA_DEV} -b