"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 <step…@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