Problem: Missed function

In pedit_dsfield.sh, the function do_test_ip_dscp_ecn() creates its own tc filter directly without going through
  do_test_pedit_dsfield():

   tools/testing/selftests/net/forwarding/pedit_dsfield.sh lines 230-232

      tc filter add $locus handle 101 pref 1              \
         flower action pedit ex munge ip dsfield set 124 retain 0xfc  \
            action pedit ex munge ip dsfield set 1 retain 0x03

This function also modifies the IP header (dsfield), but the checksum recalculation was not added here. This will
  still fail with br_netfilter enabled.

  Required fix

  The line should be:

      tc filter add $locus handle 101 pref 1              \
         flower action pedit ex munge ip dsfield set 124 retain 0xfc  \
            action pedit ex munge ip dsfield set 1 retain 0x03    \
            pipe action csum ip

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 2/1/26 00:19, Aleksei Oladko wrote:
The tests use the tc pedit action to modify the IPv4 source address
("pedit ex munge ip src set"), but the IP header checksum is not
recalculated after the modification. As a result, the modified packet
fails sanity checks in br_netfilter after bridging and is dropped,
which causes the test to fail.

Fix this by adding an explicit checksum recalculation using the
"csum ip" action, so the the modified packet contains a valid IPv4
checksum.

https://virtuozzo.atlassian.net/browse/VSTOR-123249

Signed-off-by: Aleksei Oladko <[email protected]>
---
  tools/testing/selftests/net/forwarding/pedit_dsfield.sh | 2 +-
  tools/testing/selftests/net/forwarding/pedit_ip.sh      | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/forwarding/pedit_dsfield.sh 
b/tools/testing/selftests/net/forwarding/pedit_dsfield.sh
index af008fbf2725..7cfdff525707 100755
--- a/tools/testing/selftests/net/forwarding/pedit_dsfield.sh
+++ b/tools/testing/selftests/net/forwarding/pedit_dsfield.sh
@@ -156,7 +156,7 @@ do_test_pedit_dsfield()
        local daddr=$1; shift
tc filter add $pedit_locus handle 101 pref 1 \
-          flower action pedit ex munge $pedit_action
+          flower action pedit ex munge $pedit_action pipe action csum ip
        tc filter add dev $h2 ingress handle 101 pref 1 prot $match_prot \
           flower skip_hw $match_flower action pass
diff --git a/tools/testing/selftests/net/forwarding/pedit_ip.sh b/tools/testing/selftests/net/forwarding/pedit_ip.sh
index d14efb2d23b2..a53ee3b1ef67 100755
--- a/tools/testing/selftests/net/forwarding/pedit_ip.sh
+++ b/tools/testing/selftests/net/forwarding/pedit_ip.sh
@@ -122,7 +122,7 @@ do_test_pedit_ip()
        local mz_flags=$1; shift
tc filter add $pedit_locus handle 101 pref 1 \
-          flower action pedit ex munge $pedit_action
+          flower action pedit ex munge $pedit_action pipe action csum ip
        tc filter add dev $h2 ingress handle 101 pref 1 prot $match_prot \
           flower skip_hw $match_flower action pass

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to