]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
devlink: do dry parse for extended handle with selector
authorJiri Pirko <jiri@nvidia.com>
Tue, 26 Nov 2024 09:08:27 +0000 (10:08 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 2 Dec 2024 19:19:26 +0000 (11:19 -0800)
When parsing with selector, there's a list of extended handles
(devname/busname/x) which require special treatment.
DL_OPT_HANDLEP is one of them. The code tries to parse devname/busname
handle and in case it is successful, it goes the "dump" way. However if
it's not, parsing is directly done. That is wrong, as the options may
still be incomplete. Do break in that case instead allowing to do dry
parse and possibly go the "dump" way in case the option list is not
complete.

Fixes: 70faecdca8f5 ("devlink: implement dump selector for devlink objects show commands")
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
devlink/devlink.c

index abe96f345db7ca97fba460cfb92151e6bce148d3..bba1bbf12382d33096177a0a0426eba32f9df9cb 100644 (file)
@@ -2410,7 +2410,7 @@ static int dl_argv_parse_with_selector(struct dl *dl, uint16_t *flags,
                                                o_optional);
                        if (err == -ENOENT || !err)
                                goto dump_parse;
-                       goto do_parse;
+                       break;
                }
        }