selftests/net/fcnal-test.sh: ipv6_bind failed

From: Zhou, Jie2X
Date: Tue Dec 07 2021 - 02:29:56 EST


hi,

I test ipv6_bind by "fcnal-test.sh -v -t ipv6_bind" in kernel v5.16-rc3.
There are two tests failed.

TEST: TCP socket bind to out of scope local address - ns-A loopback IPv6 [FAIL]
TEST: TCP socket bind to VRF address with device bind - VRF IPv6 [FAIL]

In fcnal-test.sh expected command error not occurred.
ipv6_addr_bind_novrf()
{
......
log_test_addr ${a} $? 1 "TCP socket bind to out of scope local address"

ipv6_addr_bind_vrf()
{
......
log_test_addr ${a} $? 1 "TCP socket bind to VRF address with device bind"

Did I set something wrong that result in these failed?
The test output is attached.

best regards,./fcnal-test.sh -v -t ipv6_bind

###########################################################################
IPv6 address binds
###########################################################################


#################################################################
No VRF


Configuring network namespaces


#######################################################
COMMAND: ip netns exec ns-A nettest -6 -s -R -P ipv6-icmp -l 2001:db8:1::1 -b

TEST: Raw socket bind to local address - ns-A IPv6 [ OK ]

#######################################################
COMMAND: ip netns exec ns-A nettest -6 -s -R -P ipv6-icmp -l 2001:db8:1::1 -I eth1 -b

TEST: Raw socket bind to local address after device bind - ns-A IPv6 [ OK ]

#######################################################
COMMAND: ip netns exec ns-A nettest -6 -s -R -P ipv6-icmp -l 2001:db8:2::1 -b

TEST: Raw socket bind to local address - ns-A loopback IPv6 [ OK ]

#######################################################
COMMAND: ip netns exec ns-A nettest -6 -s -R -P ipv6-icmp -l 2001:db8:2::1 -I eth1 -b

TEST: Raw socket bind to local address after device bind - ns-A loopback IPv6 [ OK ]

#######################################################
COMMAND: ip netns exec ns-A nettest -6 -s -l 2001:db8:1::1 -t1 -b

TEST: TCP socket bind to local address - ns-A IPv6 [ OK ]

#######################################################
COMMAND: ip netns exec ns-A nettest -6 -s -l 2001:db8:1::1 -I eth1 -t1 -b

TEST: TCP socket bind to local address after device bind - ns-A IPv6 [ OK ]

#######################################################
HINT: Should fail with 'Cannot assign requested address'

COMMAND: ip netns exec ns-A nettest -6 -s -l 2001:db8:2::1 -I eth1 -t1 -b

TEST: TCP socket bind to out of scope local address - ns-A loopback IPv6 [FAIL]

#################################################################
With VRF


Configuring network namespaces


#######################################################
COMMAND: ip netns exec ns-A nettest -6 -s -R -P ipv6-icmp -l 2001:db8:1::1 -I red -b

TEST: Raw socket bind to local address after vrf bind - ns-A IPv6 [ OK ]

#######################################################
COMMAND: ip netns exec ns-A nettest -6 -s -R -P ipv6-icmp -l 2001:db8:1::1 -I eth1 -b

TEST: Raw socket bind to local address after device bind - ns-A IPv6 [ OK ]

#######################################################
COMMAND: ip netns exec ns-A nettest -6 -s -R -P ipv6-icmp -l 2001:db8:3::1 -I red -b

TEST: Raw socket bind to local address after vrf bind - VRF IPv6 [ OK ]

#######################################################
COMMAND: ip netns exec ns-A nettest -6 -s -R -P ipv6-icmp -l 2001:db8:3::1 -I eth1 -b

TEST: Raw socket bind to local address after device bind - VRF IPv6 [ OK ]

#######################################################
HINT: Address on loopback is out of VRF scope

COMMAND: ip netns exec ns-A nettest -6 -s -R -P ipv6-icmp -l 2001:db8:2::1 -I red -b
05:14:09 server: error binding socket: 99: Cannot assign requested address

TEST: Raw socket bind to invalid local address after vrf bind - ns-A loopback IPv6 [ OK ]

#######################################################
COMMAND: ip netns exec ns-A nettest -6 -s -l 2001:db8:1::1 -I red -t1 -b

TEST: TCP socket bind to local address with VRF bind - ns-A IPv6 [ OK ]

#######################################################
COMMAND: ip netns exec ns-A nettest -6 -s -l 2001:db8:3::1 -I red -t1 -b

TEST: TCP socket bind to local address with VRF bind - VRF IPv6 [ OK ]

#######################################################
COMMAND: ip netns exec ns-A nettest -6 -s -l 2001:db8:1::1 -I eth1 -t1 -b

TEST: TCP socket bind to local address with device bind - ns-A IPv6 [ OK ]

#######################################################
COMMAND: ip netns exec ns-A nettest -6 -s -l 2001:db8:3::1 -I eth1 -t1 -b

TEST: TCP socket bind to VRF address with device bind - VRF IPv6 [FAIL]

#######################################################
HINT: Address on loopback out of scope for VRF

COMMAND: ip netns exec ns-A nettest -6 -s -l 2001:db8:2::1 -I red -t1 -b
05:14:20 server: error binding socket: 99: Cannot assign requested address

TEST: TCP socket bind to invalid local address for VRF - ns-A loopback IPv6 [ OK ]

#######################################################
HINT: Address on loopback out of scope for device in VRF

COMMAND: ip netns exec ns-A nettest -6 -s -l 2001:db8:2::1 -I eth1 -t1 -b
05:14:22 server: error binding socket: 99: Cannot assign requested address

TEST: TCP socket bind to invalid local address for device bind - ns-A loopback IPv6 [ OK ]

Tests passed: 16
Tests failed: 2