Skip to content

Commit f97b840

Browse files
skorpion17kuba-moo
authored andcommitted
selftets: seg6: disable rp_filter by default in srv6_end_dt4_l3vpn_test
On some distributions, the rp_filter is automatically set (=1) by default on a netdev basis (also on VRFs). In an SRv6 End.DT4 behavior, decapsulated IPv4 packets are routed using the table associated with the VRF bound to that tunnel. During lookup operations, the rp_filter can lead to packet loss when activated on the VRF. Therefore, we chose to make this selftest more robust by explicitly disabling the rp_filter during tests (as it is automatically set by some Linux distributions). Fixes: 2195444 ("selftests: add selftest for the SRv6 End.DT4 behavior") Reported-by: Hangbin Liu <[email protected]> Signed-off-by: Andrea Mayer <[email protected]> Tested-by: Hangbin Liu <[email protected]> Reviewed-by: David Ahern <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 21a933c commit f97b840

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,12 @@ setup_hs()
258258

259259
# set the networking for the host
260260
ip netns add ${hsname}
261+
262+
# disable the rp_filter otherwise the kernel gets confused about how
263+
# to route decap ipv4 packets.
264+
ip netns exec ${rtname} sysctl -wq net.ipv4.conf.all.rp_filter=0
265+
ip netns exec ${rtname} sysctl -wq net.ipv4.conf.default.rp_filter=0
266+
261267
ip -netns ${hsname} link add veth0 type veth peer name ${rtveth}
262268
ip -netns ${hsname} link set ${rtveth} netns ${rtname}
263269
ip -netns ${hsname} addr add ${IPv4_HS_NETWORK}.${hs}/24 dev veth0
@@ -276,11 +282,6 @@ setup_hs()
276282

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

279-
# disable the rp_filter otherwise the kernel gets confused about how
280-
# to route decap ipv4 packets.
281-
ip netns exec ${rtname} sysctl -wq net.ipv4.conf.all.rp_filter=0
282-
ip netns exec ${rtname} sysctl -wq net.ipv4.conf.${rtveth}.rp_filter=0
283-
284285
ip netns exec ${rtname} sh -c "echo 1 > /proc/sys/net/vrf/strict_mode"
285286
}
286287

0 commit comments

Comments
 (0)