diff mbox series

[net] selftests: tc-testing: fix nat regex matching

Message ID 20250331195618.535992-1-pctammela@mojatatu.com (mailing list archive)
State New
Headers show
Series [net] selftests: tc-testing: fix nat regex matching | expand

Commit Message

Pedro Tammela March 31, 2025, 7:56 p.m. UTC
In iproute 6.14, the nat ip mask logic was fixed to remove a undefined
behaviour. So now instead of reporting '0.0.0.0/32' on x86 and potentially
'0.0.0.0/0' in other platforms, it reports '0.0.0.0/0' in all platforms.

Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
---
 .../selftests/tc-testing/tc-tests/actions/nat.json | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Simon Horman April 1, 2025, 9:53 a.m. UTC | #1
On Mon, Mar 31, 2025 at 04:56:18PM -0300, Pedro Tammela wrote:
> In iproute 6.14, the nat ip mask logic was fixed to remove a undefined
> behaviour. So now instead of reporting '0.0.0.0/32' on x86 and potentially
> '0.0.0.0/0' in other platforms, it reports '0.0.0.0/0' in all platforms.
> 

Hi Pedro,

As a fix for 'net' usually a Fixes tag would go here.
But perhaps that isn't appropriate in this case for some reason?

> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>

I am assuming that you are referring to this fix:

- [PATCH iproute2-next] tc: nat: Fix mask calculation
  https://lore.kernel.org/netdev/20250306112520.188728-1-torben.nielsen@prevas.dk/

If so, it might be nice to include a reference to it in the commit message.

And also, if so, this change looks good to me:

Reviewed-by: Simon Horman <horms@kernel.org>
Pedro Tammela April 1, 2025, 2:29 p.m. UTC | #2
On 01/04/2025 06:53, Simon Horman wrote:
> On Mon, Mar 31, 2025 at 04:56:18PM -0300, Pedro Tammela wrote:
>> In iproute 6.14, the nat ip mask logic was fixed to remove a undefined
>> behaviour. So now instead of reporting '0.0.0.0/32' on x86 and potentially
>> '0.0.0.0/0' in other platforms, it reports '0.0.0.0/0' in all platforms.
>>
> 
> Hi Pedro,
> 
> As a fix for 'net' usually a Fixes tag would go here.
> But perhaps that isn't appropriate in this case for some reason?
> 
>> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
> 
> I am assuming that you are referring to this fix:
> 
> - [PATCH iproute2-next] tc: nat: Fix mask calculation
>    https://lore.kernel.org/netdev/20250306112520.188728-1-torben.nielsen@prevas.dk/
> 
> If so, it might be nice to include a reference to it in the commit message.

Will do, thanks!

> 
> And also, if so, this change looks good to me:
> 
> Reviewed-by: Simon Horman <horms@kernel.org>
diff mbox series

Patch

diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/nat.json b/tools/testing/selftests/tc-testing/tc-tests/actions/nat.json
index ee2792998c89..4f21aeb8a3fb 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/actions/nat.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/actions/nat.json
@@ -305,7 +305,7 @@ 
         "cmdUnderTest": "$TC actions add action nat ingress default 10.10.10.1 index 12",
         "expExitCode": "0",
         "verifyCmd": "$TC actions get action nat index 12",
-        "matchPattern": "action order [0-9]+:  nat ingress 0.0.0.0/32 10.10.10.1 pass.*index 12 ref",
+        "matchPattern": "action order [0-9]+:  nat ingress 0.0.0.0/0 10.10.10.1 pass.*index 12 ref",
         "matchCount": "1",
         "teardown": [
             "$TC actions flush action nat"
@@ -332,7 +332,7 @@ 
         "cmdUnderTest": "$TC actions add action nat ingress any 10.10.10.1 index 12",
         "expExitCode": "0",
         "verifyCmd": "$TC actions get action nat index 12",
-        "matchPattern": "action order [0-9]+:  nat ingress 0.0.0.0/32 10.10.10.1 pass.*index 12 ref",
+        "matchPattern": "action order [0-9]+:  nat ingress 0.0.0.0/0 10.10.10.1 pass.*index 12 ref",
         "matchCount": "1",
         "teardown": [
             "$TC actions flush action nat"
@@ -359,7 +359,7 @@ 
         "cmdUnderTest": "$TC actions add action nat ingress all 10.10.10.1 index 12",
         "expExitCode": "0",
         "verifyCmd": "$TC actions get action nat index 12",
-        "matchPattern": "action order [0-9]+:  nat ingress 0.0.0.0/32 10.10.10.1 pass.*index 12 ref",
+        "matchPattern": "action order [0-9]+:  nat ingress 0.0.0.0/0 10.10.10.1 pass.*index 12 ref",
         "matchCount": "1",
         "teardown": [
             "$TC actions flush action nat"
@@ -548,7 +548,7 @@ 
         "cmdUnderTest": "$TC actions add action nat egress default 20.20.20.1 pipe index 10",
         "expExitCode": "0",
         "verifyCmd": "$TC actions get action nat index 10",
-        "matchPattern": "action order [0-9]+:  nat egress 0.0.0.0/32 20.20.20.1 pipe.*index 10 ref",
+        "matchPattern": "action order [0-9]+:  nat egress 0.0.0.0/0 20.20.20.1 pipe.*index 10 ref",
         "matchCount": "1",
         "teardown": [
             "$TC actions flush action nat"
@@ -575,7 +575,7 @@ 
         "cmdUnderTest": "$TC actions add action nat egress any 20.20.20.1 pipe index 10",
         "expExitCode": "0",
         "verifyCmd": "$TC actions get action nat index 10",
-        "matchPattern": "action order [0-9]+:  nat egress 0.0.0.0/32 20.20.20.1 pipe.*index 10 ref",
+        "matchPattern": "action order [0-9]+:  nat egress 0.0.0.0/0 20.20.20.1 pipe.*index 10 ref",
         "matchCount": "1",
         "teardown": [
             "$TC actions flush action nat"
@@ -602,7 +602,7 @@ 
         "cmdUnderTest": "$TC actions add action nat egress all 20.20.20.1 pipe index 10",
         "expExitCode": "0",
         "verifyCmd": "$TC actions get action nat index 10",
-        "matchPattern": "action order [0-9]+:  nat egress 0.0.0.0/32 20.20.20.1 pipe.*index 10 ref",
+        "matchPattern": "action order [0-9]+:  nat egress 0.0.0.0/0 20.20.20.1 pipe.*index 10 ref",
         "matchCount": "1",
         "teardown": [
             "$TC actions flush action nat"
@@ -629,7 +629,7 @@ 
         "cmdUnderTest": "$TC actions add action nat egress all 20.20.20.1 pipe index 10 cookie aa1bc2d3eeff112233445566778800a1",
         "expExitCode": "0",
         "verifyCmd": "$TC actions get action nat index 10",
-        "matchPattern": "action order [0-9]+:  nat egress 0.0.0.0/32 20.20.20.1 pipe.*index 10 ref.*cookie aa1bc2d3eeff112233445566778800a1",
+        "matchPattern": "action order [0-9]+:  nat egress 0.0.0.0/0 20.20.20.1 pipe.*index 10 ref.*cookie aa1bc2d3eeff112233445566778800a1",
         "matchCount": "1",
         "teardown": [
             "$TC actions flush action nat"