From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Cc: dsahern@kernel.org, Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH iproute2] xfrm: report unknown object instead of usage
Date: Mon, 30 Nov 2026 10:42:37 -0800 [thread overview]
Message-ID: <20261130184237.537191-1-stephen@networkplumber.org> (raw)
"ip xfrm <unknown>" printed the usage text and exited without saying
which object was unrecognized.
Fall through to the message for an unrecognized object and keep
usage() for the explicit help request, matching every other do_*
dispatcher in the tree.
Update the help command to match.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
ip/ipxfrm.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
index 78d9e192..20d23ed6 100644
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -1566,10 +1566,9 @@ int do_xfrm(int argc, char **argv)
return do_xfrm_policy(argc-1, argv+1);
else if (matches(*argv, "monitor") == 0)
return do_xfrm_monitor(argc-1, argv+1);
- else if (matches(*argv, "help") == 0) {
+ else if (matches(*argv, "help") == 0)
usage();
- fprintf(stderr, "xfrm Object \"%s\" is unknown.\n", *argv);
- exit(-1);
- }
- usage();
+
+ fprintf(stderr, "Object \"%s\" is unknown, try \"ip xfrm help\".\n", *argv);
+ exit(-1);
}
--
2.53.0
reply other threads:[~2026-11-30 18:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261130184237.537191-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dsahern@kernel.org \
--cc=netdev@vger.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