Skip to content

Commit 77c5e3f

Browse files
author
Paolo Abeni
committed
Merge branch 'selftests-forwarding-fix-br_netfilter-related-test-failures'
Aleksei Oladko says: ==================== selftests: forwarding: fix br_netfilter related test failures This patch series fixes kselftests that fail when the br_nefilter module is loaded. The failures occur because the tests generate packets that are either modified or encapsulated, but their IP headers are not fully correct for sanity checks performed by be_netfilter. Signed-off-by: Aleksei Oladko <[email protected]> ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents 26f29b1 + a8c198d commit 77c5e3f

4 files changed

Lines changed: 33 additions & 11 deletions

File tree

tools/testing/selftests/net/forwarding/pedit_dsfield.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,20 @@ setup_prepare()
9898
h1_create
9999
h2_create
100100
switch_create
101+
102+
if [ -f /proc/sys/net/bridge/bridge-nf-call-iptables ]; then
103+
sysctl_set net.bridge.bridge-nf-call-iptables 0
104+
fi
101105
}
102106

103107
cleanup()
104108
{
105109
pre_cleanup
106110

111+
if [ -f /proc/sys/net/bridge/bridge-nf-call-iptables ]; then
112+
sysctl_restore net.bridge.bridge-nf-call-iptables
113+
fi
114+
107115
switch_destroy
108116
h2_destroy
109117
h1_destroy

tools/testing/selftests/net/forwarding/pedit_ip.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,20 @@ setup_prepare()
9191
h1_create
9292
h2_create
9393
switch_create
94+
95+
if [ -f /proc/sys/net/bridge/bridge-nf-call-iptables ]; then
96+
sysctl_set net.bridge.bridge-nf-call-iptables 0
97+
fi
9498
}
9599

96100
cleanup()
97101
{
98102
pre_cleanup
99103

104+
if [ -f /proc/sys/net/bridge/bridge-nf-call-iptables ]; then
105+
sysctl_restore net.bridge.bridge-nf-call-iptables
106+
fi
107+
100108
switch_destroy
101109
h2_destroy
102110
h1_destroy

tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,21 @@ vxlan_encapped_ping_do()
567567
local inner_tos=$1; shift
568568
local outer_tos=$1; shift
569569

570+
local ipv4hdr=$(:
571+
)"45:"$( : IP version + IHL
572+
)"$inner_tos:"$( : IP TOS
573+
)"00:54:"$( : IP total length
574+
)"99:83:"$( : IP identification
575+
)"40:00:"$( : IP flags + frag off
576+
)"40:"$( : IP TTL
577+
)"01:"$( : IP proto
578+
)"CHECKSUM:"$( : IP header csum
579+
)"c0:00:02:03:"$( : IP saddr: 192.0.2.3
580+
)"c0:00:02:01"$( : IP daddr: 192.0.2.1
581+
)
582+
local checksum=$(payload_template_calc_checksum "$ipv4hdr")
583+
ipv4hdr=$(payload_template_expand_checksum "$ipv4hdr" $checksum)
584+
570585
$MZ $dev -c $count -d 100msec -q \
571586
-b $next_hop_mac -B $dest_ip \
572587
-t udp tos=$outer_tos,sp=23456,dp=$VXPORT,p=$(:
@@ -577,16 +592,7 @@ vxlan_encapped_ping_do()
577592
)"$dest_mac:"$( : ETH daddr
578593
)"$(mac_get w2):"$( : ETH saddr
579594
)"08:00:"$( : ETH type
580-
)"45:"$( : IP version + IHL
581-
)"$inner_tos:"$( : IP TOS
582-
)"00:54:"$( : IP total length
583-
)"99:83:"$( : IP identification
584-
)"40:00:"$( : IP flags + frag off
585-
)"40:"$( : IP TTL
586-
)"01:"$( : IP proto
587-
)"00:00:"$( : IP header csum
588-
)"c0:00:02:03:"$( : IP saddr: 192.0.2.3
589-
)"c0:00:02:01:"$( : IP daddr: 192.0.2.1
595+
)"$ipv4hdr:"$( : IPv4 header
590596
)"08:"$( : ICMP type
591597
)"00:"$( : ICMP code
592598
)"8b:f2:"$( : ICMP csum

tools/testing/selftests/net/forwarding/vxlan_bridge_1d_ipv6.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ vxlan_encapped_ping_do()
695695
)"6"$( : IP version
696696
)"$inner_tos"$( : Traffic class
697697
)"0:00:00:"$( : Flow label
698-
)"00:08:"$( : Payload length
698+
)"00:03:"$( : Payload length
699699
)"3a:"$( : Next header
700700
)"04:"$( : Hop limit
701701
)"$saddr:"$( : IP saddr

0 commit comments

Comments
 (0)