netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roi Dayan <roid@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: Roi Dayan <roid@nvidia.com>, Paul Blakey <paulb@nvidia.com>,
	"Stephen Hemminger" <stephen@networkplumber.org>,
	David Ahern <dsahern@kernel.org>
Subject: [PATCH iproute2 1/2] tc: ct: Fix ct commit nat forcing addr
Date: Wed, 16 Nov 2022 09:33:11 +0200	[thread overview]
Message-ID: <20221116073312.177786-2-roid@nvidia.com> (raw)
In-Reply-To: <20221116073312.177786-1-roid@nvidia.com>

Action ct commit should accept nat src/dst without an addr. Fix it.

Fixes: c8a494314c40 ("tc: Introduce tc ct action")
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Paul Blakey <paulb@nvidia.com>
---
 man/man8/tc-ct.8 | 2 +-
 tc/m_ct.c        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/man/man8/tc-ct.8 b/man/man8/tc-ct.8
index 2fb81ca29aa4..78d05e430c36 100644
--- a/man/man8/tc-ct.8
+++ b/man/man8/tc-ct.8
@@ -47,7 +47,7 @@ Specify a masked 32bit mark to set for the connection (only valid with commit).
 Specify a masked 128bit label to set for the connection (only valid with commit).
 .TP
 .BI nat " NAT_SPEC"
-.BI Where " NAT_SPEC " ":= {src|dst} addr" " addr1" "[-" "addr2" "] [port " "port1" "[-" "port2" "]]"
+.BI Where " NAT_SPEC " ":= {src|dst} [addr" " addr1" "[-" "addr2" "] [port " "port1" "[-" "port2" "]]]"
 
 Specify src/dst and range of nat to configure for the connection (only valid with commit).
 .RS
diff --git a/tc/m_ct.c b/tc/m_ct.c
index a02bf0cc1655..1b8984075a67 100644
--- a/tc/m_ct.c
+++ b/tc/m_ct.c
@@ -23,7 +23,7 @@ usage(void)
 		"	ct commit [force] [zone ZONE] [mark MASKED_MARK] [label MASKED_LABEL] [nat NAT_SPEC]\n"
 		"	ct [nat] [zone ZONE]\n"
 		"Where: ZONE is the conntrack zone table number\n"
-		"	NAT_SPEC is {src|dst} addr addr1[-addr2] [port port1[-port2]]\n"
+		"	NAT_SPEC is {src|dst} [addr addr1[-addr2] [port port1[-port2]]]\n"
 		"\n");
 	exit(-1);
 }
@@ -234,7 +234,7 @@ parse_ct(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
 
 			NEXT_ARG();
 			if (matches(*argv, "addr") != 0)
-				usage();
+				continue;
 
 			NEXT_ARG();
 			ret = ct_parse_nat_addr_range(*argv, n);
-- 
2.38.0


  reply	other threads:[~2022-11-16  7:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16  7:33 [PATCH iproute2 0/2] two fixes for tc ct command Roi Dayan
2022-11-16  7:33 ` Roi Dayan [this message]
2022-11-16 18:21   ` [PATCH iproute2 1/2] tc: ct: Fix ct commit nat forcing addr Stephen Hemminger
2022-11-17  5:35     ` Roi Dayan
2022-11-17 14:00       ` Roi Dayan
2022-11-24  8:21         ` Roi Dayan
2022-11-16  7:33 ` [PATCH iproute2 2/2] tc: ct: Fix invalid pointer derefence Roi Dayan

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=20221116073312.177786-2-roid@nvidia.com \
    --to=roid@nvidia.com \
    --cc=dsahern@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulb@nvidia.com \
    --cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).