public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Aleksei Oladko <aleksey.oladko@virtuozzo.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>,
	Petr Machata <petrm@nvidia.com>, Nir Dotan <nird@mellanox.com>,
	netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] selftests: net: forwarding: fix IPv6 address leak in cleanup
Date: Sun, 1 Mar 2026 14:40:52 +0200	[thread overview]
Message-ID: <20260301124052.GA713428@shredder> (raw)
In-Reply-To: <20260301014706.454243-1-aleksey.oladko@virtuozzo.com>

On Sun, Mar 01, 2026 at 01:47:06AM +0000, Aleksei Oladko wrote:
> Several forwarding tests (e.g., gre_multipath.sh) initialize both IPv4
> and IPv6 addresses using simple_if_init, but only clean up IPv4
> in simple_if_fini. This leaves stale IPv6 addresses on the interfaces,
> which causes subsequent tests to fail when they encounter unexpected
> address configuration.
> 
> The issue can be reproduced by running tests in sequence:
>   # run_kselftest.sh -t net/forwarding:ipip_hier_gre.sh
>   # run_kselftest.sh -t net/forwarding:min_max_mtu.sh
>   TAP version 13
>   1..1
>   # timeout set to 0
>   # selftests: net/forwarding: min_max_mtu.sh
>   # TEST: ping                                                          [ OK ]
>   # TEST: ping6                                                         [ OK ]
>   # TEST: Test maximum MTU configuration                                [ OK ]
>   # TEST: Test traffic, packet size is maximum MTU                      [FAIL]
>   #       Ping6, packet size: 65487 succeeded, but should have failed
>   # TEST: Test minimum MTU configuration                                [ OK ]
>   # TEST: Test traffic, packet size is minimum MTU                      [ OK ]
>   not ok 1 selftests: net/forwarding: min_max_mtu.sh # exit=1
> 
> Fix this by adding the missing IPv6 argument to simple_if_fini in
> all affected tests.
> 
> Fixes: fed926d4f64c ("selftests: forwarding: Add IP tunneling lib")
> Fixes: 902280cacc03 ("selftests: forwarding: Add resilient multipath tunneling nexthop test")
> Fixes: 54818c4c4b93 ("selftests: forwarding: Test multipath tunneling")
> Fixes: e035146d6560 ("selftests: forwarding: Add multipath tunneling nexthop test")
> 

Please remove the blank line

> Signed-off-by: Aleksei Oladko <aleksey.oladko@virtuozzo.com>
> ---
>  tools/testing/selftests/net/forwarding/gre_multipath.sh        | 2 +-
>  tools/testing/selftests/net/forwarding/gre_multipath_nh.sh     | 2 +-
>  tools/testing/selftests/net/forwarding/gre_multipath_nh_res.sh | 2 +-
>  tools/testing/selftests/net/forwarding/ipip_lib.sh             | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/testing/selftests/net/forwarding/gre_multipath.sh b/tools/testing/selftests/net/forwarding/gre_multipath.sh
> index 57531c1d884d..397422cd5aea 100755
> --- a/tools/testing/selftests/net/forwarding/gre_multipath.sh
> +++ b/tools/testing/selftests/net/forwarding/gre_multipath.sh
> @@ -72,7 +72,7 @@ h1_create()
>  h1_destroy()
>  {
>  	ip route del vrf v$h1 192.0.2.16/28 via 192.0.2.2
> -	simple_if_fini $h1 192.0.2.1/28
> +	simple_if_fini $h1 192.0.2.1/28 2001:db8:1::1/64

The test only runs IPv4 traffic in the overlay, so I believe the IPv6
address can be removed from h1 (h2 doesn't have one as well):

diff --git a/tools/testing/selftests/net/forwarding/gre_multipath.sh b/tools/testing/selftests/net/forwarding/gre_multipath.sh
index 57531c1d884d..ce4ae74843d9 100755
--- a/tools/testing/selftests/net/forwarding/gre_multipath.sh
+++ b/tools/testing/selftests/net/forwarding/gre_multipath.sh
@@ -65,7 +65,7 @@ source lib.sh
 
 h1_create()
 {
-	simple_if_init $h1 192.0.2.1/28 2001:db8:1::1/64
+	simple_if_init $h1 192.0.2.1/28
 	ip route add vrf v$h1 192.0.2.16/28 via 192.0.2.2
 }

>  }
>  
>  sw1_create()
> diff --git a/tools/testing/selftests/net/forwarding/gre_multipath_nh.sh b/tools/testing/selftests/net/forwarding/gre_multipath_nh.sh
> index 7d5b2b9cc133..c667b81da37f 100755
> --- a/tools/testing/selftests/net/forwarding/gre_multipath_nh.sh
> +++ b/tools/testing/selftests/net/forwarding/gre_multipath_nh.sh
> @@ -80,7 +80,7 @@ h1_destroy()
>  {
>  	ip route del vrf v$h1 2001:db8:2::/64 via 2001:db8:1::2
>  	ip route del vrf v$h1 192.0.2.16/28 via 192.0.2.2
> -	simple_if_fini $h1 192.0.2.1/28
> +	simple_if_fini $h1 192.0.2.1/28 2001:db8:1::1/64
>  }
>  
>  sw1_create()
> diff --git a/tools/testing/selftests/net/forwarding/gre_multipath_nh_res.sh b/tools/testing/selftests/net/forwarding/gre_multipath_nh_res.sh
> index 370f9925302d..d04bad58a96a 100755
> --- a/tools/testing/selftests/net/forwarding/gre_multipath_nh_res.sh
> +++ b/tools/testing/selftests/net/forwarding/gre_multipath_nh_res.sh
> @@ -80,7 +80,7 @@ h1_destroy()
>  {
>  	ip route del vrf v$h1 2001:db8:2::/64 via 2001:db8:1::2
>  	ip route del vrf v$h1 192.0.2.16/28 via 192.0.2.2
> -	simple_if_fini $h1 192.0.2.1/28
> +	simple_if_fini $h1 192.0.2.1/28 2001:db8:1::1/64
>  }
>  
>  sw1_create()
> diff --git a/tools/testing/selftests/net/forwarding/ipip_lib.sh b/tools/testing/selftests/net/forwarding/ipip_lib.sh
> index 01e62c4ac94d..a5c23a28d50e 100644
> --- a/tools/testing/selftests/net/forwarding/ipip_lib.sh
> +++ b/tools/testing/selftests/net/forwarding/ipip_lib.sh
> @@ -151,7 +151,7 @@ h1_create()
>  h1_destroy()
>  {
>  	ip route del vrf v$h1 192.0.2.16/28 via 192.0.2.2
> -	simple_if_fini $h1 192.0.2.1/28
> +	simple_if_fini $h1 192.0.2.1/28 2001:db8:1::1/64

Let's remove the IPv6 address in this case as well. Looks like it was
added by mistake:

diff --git a/tools/testing/selftests/net/forwarding/ipip_lib.sh b/tools/testing/selftests/net/forwarding/ipip_lib.sh
index 01e62c4ac94d..b255646b737a 100644
--- a/tools/testing/selftests/net/forwarding/ipip_lib.sh
+++ b/tools/testing/selftests/net/forwarding/ipip_lib.sh
@@ -144,7 +144,7 @@
 
 h1_create()
 {
-	simple_if_init $h1 192.0.2.1/28 2001:db8:1::1/64
+	simple_if_init $h1 192.0.2.1/28
 	ip route add vrf v$h1 192.0.2.16/28 via 192.0.2.2
 }

>  }
>  
>  h2_create()
> -- 
> 2.43.0
> 

      reply	other threads:[~2026-03-01 12:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-01  1:47 [PATCH net] selftests: net: forwarding: fix IPv6 address leak in cleanup Aleksei Oladko
2026-03-01 12:40 ` Ido Schimmel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260301124052.GA713428@shredder \
    --to=idosch@nvidia.com \
    --cc=aleksey.oladko@virtuozzo.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nird@mellanox.com \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox