diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-01-04 15:28:28 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-01-04 15:28:28 +0000 |
commit | 83c44229d24b1e09c772c8e8e0ee4abad78139a6 (patch) | |
tree | c62e33810b7e3a376140e6056f6966996d7e6216 | |
parent | 21e20cb4ad106b9d49ff24652a5cd47380905d4d (diff) | |
download | busybox-w32-83c44229d24b1e09c772c8e8e0ee4abad78139a6.tar.gz busybox-w32-83c44229d24b1e09c772c8e8e0ee4abad78139a6.tar.bz2 busybox-w32-83c44229d24b1e09c772c8e8e0ee4abad78139a6.zip |
ip route: "ip route" was misbehaving (extra argv+1 ate 1st env var)
-rw-r--r-- | networking/libiproute/iproute.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c index ce2cd8b39..5ded99b2e 100644 --- a/networking/libiproute/iproute.c +++ b/networking/libiproute/iproute.c | |||
@@ -841,15 +841,17 @@ int do_iproute(char **argv) | |||
841 | /*0-3*/ "add\0""append\0""change\0""chg\0" | 841 | /*0-3*/ "add\0""append\0""change\0""chg\0" |
842 | /*4-7*/ "delete\0""get\0""list\0""show\0" | 842 | /*4-7*/ "delete\0""get\0""list\0""show\0" |
843 | /*8..*/ "prepend\0""replace\0""test\0""flush\0"; | 843 | /*8..*/ "prepend\0""replace\0""test\0""flush\0"; |
844 | int command_num = 6; | 844 | int command_num; |
845 | unsigned flags = 0; | 845 | unsigned flags = 0; |
846 | int cmd = RTM_NEWROUTE; | 846 | int cmd = RTM_NEWROUTE; |
847 | 847 | ||
848 | if (!*argv) | ||
849 | return iproute_list_or_flush(argv, 0); | ||
850 | |||
848 | /* "Standard" 'ip r a' treats 'a' as 'add', not 'append' */ | 851 | /* "Standard" 'ip r a' treats 'a' as 'add', not 'append' */ |
849 | /* It probably means that it is using "first match" rule */ | 852 | /* It probably means that it is using "first match" rule */ |
850 | if (*argv) { | 853 | command_num = index_in_substrings(ip_route_commands, *argv); |
851 | command_num = index_in_substrings(ip_route_commands, *argv); | 854 | |
852 | } | ||
853 | switch (command_num) { | 855 | switch (command_num) { |
854 | case 0: /* add */ | 856 | case 0: /* add */ |
855 | flags = NLM_F_CREATE|NLM_F_EXCL; | 857 | flags = NLM_F_CREATE|NLM_F_EXCL; |