Skip to content

Commit

Permalink
selftests: forwarding: Add missing 'rp_filter' configuration
Browse files Browse the repository at this point in the history
[ Upstream commit 71a0e29 ]

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: 1538812 ("selftests: forwarding: Add a test for VXLAN asymmetric routing")
Fixes: 438a4f5 ("selftests: forwarding: Add a test for VXLAN symmetric routing")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reported-by: Hangbin Liu <liuhangbin@gmail.com>
Tested-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://lore.kernel.org/r/20201015084525.135121-1-idosch@idosch.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
idosch authored and gregkh committed Oct 29, 2020
1 parent 11a3f1f commit 8ab1b9e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tools/testing/selftests/net/forwarding/vxlan_asymmetric.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 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()
{
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 10

Expand Down Expand Up @@ -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 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

Expand Down
10 changes: 10 additions & 0 deletions tools/testing/selftests/net/forwarding/vxlan_symmetric.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 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()
{
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 10

Expand Down Expand Up @@ -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 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

Expand Down

0 comments on commit 8ab1b9e

Please sign in to comment.