Commit 77c5e3fd authored by Paolo Abeni's avatar Paolo Abeni
Browse files

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: default avatarAleksei Oladko <aleksey.oladko@virtuozzo.com>
====================

Link: https://patch.msgid.link/20260213131907.43351-1-aleksey.oladko@virtuozzo.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents 26f29b14 a8c198d1
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -98,12 +98,20 @@ setup_prepare()
	h1_create
	h2_create
	switch_create

	if [ -f /proc/sys/net/bridge/bridge-nf-call-iptables ]; then
		sysctl_set net.bridge.bridge-nf-call-iptables 0
	fi
}

cleanup()
{
	pre_cleanup

	if [ -f /proc/sys/net/bridge/bridge-nf-call-iptables ]; then
		sysctl_restore net.bridge.bridge-nf-call-iptables
	fi

	switch_destroy
	h2_destroy
	h1_destroy
+8 −0
Original line number Diff line number Diff line
@@ -91,12 +91,20 @@ setup_prepare()
	h1_create
	h2_create
	switch_create

	if [ -f /proc/sys/net/bridge/bridge-nf-call-iptables ]; then
		sysctl_set net.bridge.bridge-nf-call-iptables 0
	fi
}

cleanup()
{
	pre_cleanup

	if [ -f /proc/sys/net/bridge/bridge-nf-call-iptables ]; then
		sysctl_restore net.bridge.bridge-nf-call-iptables
	fi

	switch_destroy
	h2_destroy
	h1_destroy
+16 −10
Original line number Diff line number Diff line
@@ -567,6 +567,21 @@ vxlan_encapped_ping_do()
	local inner_tos=$1; shift
	local outer_tos=$1; shift

	local ipv4hdr=$(:
		    )"45:"$(                      : IP version + IHL
		    )"$inner_tos:"$(              : IP TOS
		    )"00:54:"$(                   : IP total length
		    )"99:83:"$(                   : IP identification
		    )"40:00:"$(                   : IP flags + frag off
		    )"40:"$(                      : IP TTL
		    )"01:"$(                      : IP proto
		    )"CHECKSUM:"$(                : IP header csum
		    )"c0:00:02:03:"$(             : IP saddr: 192.0.2.3
		    )"c0:00:02:01"$(              : IP daddr: 192.0.2.1
		)
	local checksum=$(payload_template_calc_checksum "$ipv4hdr")
	ipv4hdr=$(payload_template_expand_checksum "$ipv4hdr" $checksum)

	$MZ $dev -c $count -d 100msec -q \
		-b $next_hop_mac -B $dest_ip \
		-t udp tos=$outer_tos,sp=23456,dp=$VXPORT,p=$(:
@@ -577,16 +592,7 @@ vxlan_encapped_ping_do()
		    )"$dest_mac:"$(               : ETH daddr
		    )"$(mac_get w2):"$(           : ETH saddr
		    )"08:00:"$(                   : ETH type
		    )"45:"$(                      : IP version + IHL
		    )"$inner_tos:"$(              : IP TOS
		    )"00:54:"$(                   : IP total length
		    )"99:83:"$(                   : IP identification
		    )"40:00:"$(                   : IP flags + frag off
		    )"40:"$(                      : IP TTL
		    )"01:"$(                      : IP proto
		    )"00:00:"$(                   : IP header csum
		    )"c0:00:02:03:"$(             : IP saddr: 192.0.2.3
		    )"c0:00:02:01:"$(             : IP daddr: 192.0.2.1
		    )"$ipv4hdr:"$(                : IPv4 header
		    )"08:"$(                      : ICMP type
		    )"00:"$(                      : ICMP code
		    )"8b:f2:"$(                   : ICMP csum
+1 −1
Original line number Diff line number Diff line
@@ -695,7 +695,7 @@ vxlan_encapped_ping_do()
		    )"6"$(			  : IP version
		    )"$inner_tos"$(               : Traffic class
		    )"0:00:00:"$(                 : Flow label
		    )"00:08:"$(                   : Payload length
		    )"00:03:"$(                   : Payload length
		    )"3a:"$(                      : Next header
		    )"04:"$(                      : Hop limit
		    )"$saddr:"$(		  : IP saddr