All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Konstantin Khorenko <khorenko@virtuozzo.com>, devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 v3 2/5] selftests: netfilter: let the router send redirects
Date: Thu, 24 Sep 2026 13:06:07 +0200	[thread overview]
Message-ID: <20260924-b4-prep-netfilter-v3-2-e6a17b8f193f@virtuozzo.com> (raw)
In-Reply-To: <20260924-b4-prep-netfilter-v3-0-e6a17b8f193f@virtuozzo.com>

From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>

The icmp_redirect part of conntrack_icmp_related.sh waits for the router
to send an ICMP redirect, but a new namespace takes send_redirects from
init_net, and it is commonly turned off there:

  # ip netns exec "$nsrouter1" \
  #     cat /proc/sys/net/ipv4/conf/all/send_redirects
  0

with nothing sent, the test times out waiting. Ask for it on the router
that is supposed to send them.

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>
---
v3: say the value is copied from init_net rather than from the
    creating namespace.
---
 tools/testing/selftests/net/netfilter/conntrack_icmp_related.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/testing/selftests/net/netfilter/conntrack_icmp_related.sh b/tools/testing/selftests/net/netfilter/conntrack_icmp_related.sh
index c63d840ead61f..44a98c53d085e 100755
--- a/tools/testing/selftests/net/netfilter/conntrack_icmp_related.sh
+++ b/tools/testing/selftests/net/netfilter/conntrack_icmp_related.sh
@@ -253,6 +253,12 @@ else
 fi
 
 # add 'bad' route,  expect icmp REDIRECT to be generated
+# A new namespace inherits send_redirects from the host, where it is
+# often turned off; without it the router never sends the redirect this
+# part of the test waits for.
+ip netns exec "$nsrouter1" sysctl -q net.ipv4.conf.all.send_redirects=1
+ip netns exec "$nsrouter1" sysctl -q net.ipv4.conf.default.send_redirects=1
+
 ip netns exec "${nsclient1}" ip route add 192.168.1.42 via 192.168.1.1
 ip netns exec "${nsclient1}" ip route add dead:1::42 via dead:1::1
 

-- 
2.43.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  parent reply	other threads:[~2026-09-24 11:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 11:06 [Devel] [PATCH hci-8.1 v3 0/5] selftests: netfilter: make the suite pass on a routing host Konstantin Khorenko
2026-09-24 11:06 ` [Devel] [PATCH hci-8.1 v3 1/5] selftests: net: turn ip_forward off in setup_ns Konstantin Khorenko
2026-09-24 11:06 ` Konstantin Khorenko [this message]
2026-09-24 11:06 ` [Devel] [PATCH hci-8.1 v3 3/5] selftests: netfilter: add the veth pair from inside the namespace Konstantin Khorenko
2026-09-24 11:06 ` [Devel] [PATCH hci-8.1 v3 4/5] selftests: netfilter: skip rpath.sh without the nft tool Konstantin Khorenko
2026-09-24 11:06 ` [Devel] [PATCH hci-8.1 v3 5/5] selftests: netfilter: account for a per-namespace nf_conntrack_expect_max Konstantin Khorenko
2026-09-24 11:09 ` [Devel] [PATCH hci-8.1 v3 0/5] selftests: netfilter: make the suite pass on a routing host Konstantin Khorenko

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=20260924-b4-prep-netfilter-v3-2-e6a17b8f193f@virtuozzo.com \
    --to=khorenko@virtuozzo.com \
    --cc=devel@openvz.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.