OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
* [Devel] [PATCH vz10] selftests: mptcp: turn forwarding off in the test namespaces
@ 2026-08-21 15:20 Eva Kurchatova
  2026-08-24 16:47 ` [Devel] [PATCH RHEL10 COMMIT] " Konstantin Khorenko
  0 siblings, 1 reply; 2+ messages in thread
From: Eva Kurchatova @ 2026-08-21 15:20 UTC (permalink / raw)


A new namespace inherits net.ipv4.ip_forward from the host, so on a host
that routes, so do the namespaces these tests build.

"invalid address, ADD_ADDR timeout" then reports 0 JOINs where it wants
1.  The server announces an unreachable address first and a valid one
after it.  With forwarding on, the SYN to the unreachable address draws
an ICMP error instead of being dropped, so the subflow attempt fails at
once and the next ADD_ADDR retransmission starts another one.  Every
attempt that no longer finds its predecessor bumps add_addr_accepted, so
the unreachable address alone uses up both accepted slots and the valid
address that follows is dropped without ever getting a subflow.

The two tests that do need a router, mptcp_connect.sh and
simult_flows.sh, turn forwarding on themselves for those namespaces, so
switching it off in the common setup is enough.

https://virtuozzo.atlassian.net/browse/VSTOR-139651
Feature: fix selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
 tools/testing/selftests/net/mptcp/mptcp_lib.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
index a326f34fc719..43112e1c8c59 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
@@ -455,6 +455,13 @@ mptcp_lib_ns_init() {
 	local netns
 	for netns in "${@}"; do
 		ip netns exec "${!netns}" sysctl -q net.mptcp.enabled=1
+		# The tests that need a router enable forwarding themselves,
+		# everywhere else it has to be off: a new namespace inherits
+		# the setting, so on a host that routes, an unreachable
+		# announced address is answered with an ICMP error instead of
+		# being silently dropped.
+		ip netns exec "${!netns}" sysctl -q net.ipv4.ip_forward=0
+		ip netns exec "${!netns}" sysctl -q net.ipv6.conf.all.forwarding=0
 	done
 }
 
-- 
2.55.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Devel] [PATCH RHEL10 COMMIT] selftests: mptcp: turn forwarding off in the test namespaces
  2026-08-21 15:20 [Devel] [PATCH vz10] selftests: mptcp: turn forwarding off in the test namespaces Eva Kurchatova
@ 2026-08-24 16:47 ` Konstantin Khorenko
  0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Khorenko @ 2026-08-24 16:47 UTC (permalink / raw)


The commit is pushed to "branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-211.39.1.16.8.vz10
------>
commit 38b336063172bfdcdcc0460edf97794870c0a2d4
Author: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Date:   Fri Aug 21 18:20:28 2026 +0300

    selftests: mptcp: turn forwarding off in the test namespaces
    
    A new namespace inherits net.ipv4.ip_forward from the host, so on a host
    that routes, so do the namespaces these tests build.
    IPv6 forwarding is inheritable too, depending on
    net.core.devconf_inherit_init_net, so turn both off.
    
    Only IPv4 is inherited with the default
    net.core.devconf_inherit_init_net: devinet_init_net() copies devconf
    from init_net for 0 and 1, while addrconf_init_net() uses the compiled
    defaults for 0. Turn IPv6 forwarding off as well, it becomes inheritable
    once that knob is 1 or 3, and the tests which do need a router enable
    both anyway.
    
    "invalid address, ADD_ADDR timeout" then reports 0 JOINs where it wants
    1. The server announces an unreachable address first and a valid one
    after it. With forwarding on, the SYN to the unreachable address draws
    an ICMP error instead of being dropped, so the subflow attempt fails at
    once and the next ADD_ADDR retransmission starts another one. Every
    attempt that no longer finds its predecessor bumps add_addr_accepted, so
    the unreachable address alone uses up both accepted slots and the valid
    address that follows is dropped without ever getting a subflow.
    
    The two tests that do need a router, mptcp_connect.sh and
    simult_flows.sh, turn forwarding on themselves for those namespaces, so
    switching it off in the common setup is enough.
    
    https://virtuozzo.atlassian.net/browse/VSTOR-139651
    Feature: fix selftests
    Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
    Reviewed-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 tools/testing/selftests/net/mptcp/mptcp_lib.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
index a326f34fc719..43112e1c8c59 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
@@ -455,6 +455,13 @@ mptcp_lib_ns_init() {
 	local netns
 	for netns in "${@}"; do
 		ip netns exec "${!netns}" sysctl -q net.mptcp.enabled=1
+		# The tests that need a router enable forwarding themselves,
+		# everywhere else it has to be off: a new namespace inherits
+		# the setting, so on a host that routes, an unreachable
+		# announced address is answered with an ICMP error instead of
+		# being silently dropped.
+		ip netns exec "${!netns}" sysctl -q net.ipv4.ip_forward=0
+		ip netns exec "${!netns}" sysctl -q net.ipv6.conf.all.forwarding=0
 	done
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-24 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-21 15:20 [Devel] [PATCH vz10] selftests: mptcp: turn forwarding off in the test namespaces Eva Kurchatova
2026-08-24 16:47 ` [Devel] [PATCH RHEL10 COMMIT] " Konstantin Khorenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox