Netdev List
 help / color / mirror / Atom feed
* [PATCH iproute2] xfrm: report unknown object instead of usage
@ 2026-11-30 18:42 Stephen Hemminger
  2026-11-30 19:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2026-11-30 18:42 UTC (permalink / raw)
  To: netdev; +Cc: dsahern, Stephen Hemminger

"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


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

* Re: [PATCH iproute2] xfrm: report unknown object instead of usage
  2026-11-30 18:42 [PATCH iproute2] xfrm: report unknown object instead of usage Stephen Hemminger
@ 2026-11-30 19:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-11-30 19:30 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, dsahern

Hello:

This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:

On Mon, 30 Nov 2026 10:42:37 -0800 you wrote:
> "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.
> 
> [...]

Here is the summary with links:
  - [iproute2] xfrm: report unknown object instead of usage
    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=2785659ee4ff

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2026-11-30 19:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 18:42 [PATCH iproute2] xfrm: report unknown object instead of usage Stephen Hemminger
2026-11-30 19:30 ` patchwork-bot+netdevbpf

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