Commit 71a0e29e authored by Ido Schimmel's avatar Ido Schimmel Committed by Jakub Kicinski

selftests: forwarding: Add missing 'rp_filter' configuration

When 'rp_filter' is configured in strict mode (1) the tests fail because
packets received from the macvlan netdevs would not be forwarded through
them on the reverse path.

Fix this by disabling the 'rp_filter', meaning no source validation is
performed.

Fixes: 1538812e ("selftests: forwarding: Add a test for VXLAN asymmetric routing")
Fixes: 438a4f56 ("selftests: forwarding: Add a test for VXLAN symmetric routing")
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Reported-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Tested-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Link: https://lore.kernel.org/r/20201015084525.135121-1-idosch@idosch.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent f981fc3d
...@@ -215,10 +215,16 @@ switch_create() ...@@ -215,10 +215,16 @@ switch_create()
bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 10 bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 10
bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 20 bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 20
sysctl_set net.ipv4.conf.all.rp_filter 0
sysctl_set net.ipv4.conf.vlan10-v.rp_filter 0
sysctl_set net.ipv4.conf.vlan20-v.rp_filter 0
} }
switch_destroy() switch_destroy()
{ {
sysctl_restore net.ipv4.conf.all.rp_filter
bridge fdb del 00:00:5e:00:01:01 dev br1 self local vlan 20 bridge fdb del 00:00:5e:00:01:01 dev br1 self local vlan 20
bridge fdb del 00:00:5e:00:01:01 dev br1 self local vlan 10 bridge fdb del 00:00:5e:00:01:01 dev br1 self local vlan 10
...@@ -359,6 +365,10 @@ ns_switch_create() ...@@ -359,6 +365,10 @@ ns_switch_create()
bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 10 bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 10
bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 20 bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 20
sysctl_set net.ipv4.conf.all.rp_filter 0
sysctl_set net.ipv4.conf.vlan10-v.rp_filter 0
sysctl_set net.ipv4.conf.vlan20-v.rp_filter 0
} }
export -f ns_switch_create export -f ns_switch_create
......
...@@ -237,10 +237,16 @@ switch_create() ...@@ -237,10 +237,16 @@ switch_create()
bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 10 bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 10
bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 20 bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 20
sysctl_set net.ipv4.conf.all.rp_filter 0
sysctl_set net.ipv4.conf.vlan10-v.rp_filter 0
sysctl_set net.ipv4.conf.vlan20-v.rp_filter 0
} }
switch_destroy() switch_destroy()
{ {
sysctl_restore net.ipv4.conf.all.rp_filter
bridge fdb del 00:00:5e:00:01:01 dev br1 self local vlan 20 bridge fdb del 00:00:5e:00:01:01 dev br1 self local vlan 20
bridge fdb del 00:00:5e:00:01:01 dev br1 self local vlan 10 bridge fdb del 00:00:5e:00:01:01 dev br1 self local vlan 10
...@@ -402,6 +408,10 @@ ns_switch_create() ...@@ -402,6 +408,10 @@ ns_switch_create()
bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 10 bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 10
bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 20 bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 20
sysctl_set net.ipv4.conf.all.rp_filter 0
sysctl_set net.ipv4.conf.vlan10-v.rp_filter 0
sysctl_set net.ipv4.conf.vlan20-v.rp_filter 0
} }
export -f ns_switch_create export -f ns_switch_create
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment