]> git.ipfire.org Git - thirdparty/iproute2.git/commit
ip: error out if iplink does not consume all options
authorJakub Kicinski <kuba@kernel.org>
Mon, 31 Jul 2023 16:19:20 +0000 (09:19 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 31 Jul 2023 16:56:44 +0000 (09:56 -0700)
commit84ffffeb0a2ff69e36bd972d57699f9e3bb29a48
tree1ad0f5758bc5934afb9915a83ce79a183882f38c
parent13a5d8fcb41bbc5875c0a6c150236208eadd3936
ip: error out if iplink does not consume all options

dummy does not define .parse_opt, which make ip ignore all
trailing arguments, for example:

 # ip link add type dummy a b c d e f name cheese

will work just fine (and won't call the device "cheese").
Error out in this case with a clear error message:

 # ip link add type dummy a b c d e f name cheese
 Garbage instead of arguments "a ...". Try "ip link help".

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/iplink.c