]> git.ipfire.org Git - thirdparty/iproute2.git/commit
ip: drop 2-char command assumption
authorTony Ambardar <tony.ambardar@gmail.com>
Tue, 20 Apr 2021 08:26:36 +0000 (01:26 -0700)
committerDavid Ahern <dsahern@kernel.org>
Mon, 26 Apr 2021 02:29:42 +0000 (02:29 +0000)
commite705b19d489f769228902e100b4f375c03becfbb
treea4b4a8b8c5a5481cd71c5e663c5d58fa8bc890d0
parent81bfd01a4c9e6824c947b8f972faf9c136cd387b
ip: drop 2-char command assumption

The 'ip' utility hardcodes the assumption of being a 2-char command, where
any follow-on characters are passed as an argument:

  $ ./ip-full help
  Object "-full" is unknown, try "ip help".

This confusing behaviour isn't seen with 'tc' for example, and was added in
a 2005 commit without documentation. It was noticed during testing of 'ip'
variants built/packaged with different feature sets (e.g. w/o BPF support).

Mitigate the problem by redoing the command without the 2-char assumption
if the follow-on characters fail to parse as a valid command.

Fixes: 351efcde4e62 ("Update header files to 2.6.14")
Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
ip/ip.c