Commit 7ce93d6f authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'selftests-seg6-make-srv6_end_dt4_l3vpn_test-more-robust'

Andrea Mayer says:

====================
selftests: seg6: make srv6_end_dt4_l3vpn_test more robust

This pachset aims to improve and make more robust the selftests performed to
check whether SRv6 End.DT4 beahvior works as expected under different system
configurations.
Some Linux distributions enable Deduplication Address Detection and Reverse
Path Filtering mechanisms by default which can interfere with SRv6 End.DT4
behavior and cause selftests to fail.

The following patches improve selftests for End.DT4 by taking these two
mechanisms into account. Specifically:
 - patch 1/2: selftests: seg6: disable DAD on IPv6 router cfg for
              srv6_end_dt4_l3vpn_test
 - patch 2/2: selftets: seg6: disable rp_filter by default in
              srv6_end_dt4_l3vpn_test
====================

Link: https://lore.kernel.org/r/20230510111638.12408-1-andrea.mayer@uniroma2.it


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 6e27831b f97b8401
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -232,10 +232,14 @@ setup_rt_networking()
	local nsname=rt-${rt}

	ip netns add ${nsname}

	ip netns exec ${nsname} sysctl -wq net.ipv6.conf.all.accept_dad=0
	ip netns exec ${nsname} sysctl -wq net.ipv6.conf.default.accept_dad=0

	ip link set veth-rt-${rt} netns ${nsname}
	ip -netns ${nsname} link set veth-rt-${rt} name veth0

	ip -netns ${nsname} addr add ${IPv6_RT_NETWORK}::${rt}/64 dev veth0
	ip -netns ${nsname} addr add ${IPv6_RT_NETWORK}::${rt}/64 dev veth0 nodad
	ip -netns ${nsname} link set veth0 up
	ip -netns ${nsname} link set lo up

@@ -254,6 +258,12 @@ setup_hs()

	# set the networking for the host
	ip netns add ${hsname}

	# disable the rp_filter otherwise the kernel gets confused about how
	# to route decap ipv4 packets.
	ip netns exec ${rtname} sysctl -wq net.ipv4.conf.all.rp_filter=0
	ip netns exec ${rtname} sysctl -wq net.ipv4.conf.default.rp_filter=0

	ip -netns ${hsname} link add veth0 type veth peer name ${rtveth}
	ip -netns ${hsname} link set ${rtveth} netns ${rtname}
	ip -netns ${hsname} addr add ${IPv4_HS_NETWORK}.${hs}/24 dev veth0
@@ -272,11 +282,6 @@ setup_hs()

	ip netns exec ${rtname} sysctl -wq net.ipv4.conf.${rtveth}.proxy_arp=1

	# disable the rp_filter otherwise the kernel gets confused about how
	# to route decap ipv4 packets.
	ip netns exec ${rtname} sysctl -wq net.ipv4.conf.all.rp_filter=0
	ip netns exec ${rtname} sysctl -wq net.ipv4.conf.${rtveth}.rp_filter=0

	ip netns exec ${rtname} sh -c "echo 1 > /proc/sys/net/vrf/strict_mode"
}