aboutsummaryrefslogtreecommitdiff
path: root/networking/libiproute/iproute.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/libiproute/iproute.c')
-rw-r--r--networking/libiproute/iproute.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index 3b2a677d9..9c3b87040 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -670,7 +670,7 @@ static int iproute_get(int argc, char **argv)
670 req.r.rtm_tos = 0; 670 req.r.rtm_tos = 0;
671 671
672 while (argc > 0) { 672 while (argc > 0) {
673 switch (compare_string_array(options, *argv)) { 673 switch (index_in_str_array(options, *argv)) {
674 case 0: /* from */ 674 case 0: /* from */
675 { 675 {
676 inet_prefix addr; 676 inet_prefix addr;
@@ -811,14 +811,16 @@ static int iproute_get(int argc, char **argv)
811int do_iproute(int argc, char **argv) 811int do_iproute(int argc, char **argv)
812{ 812{
813 static const char * const ip_route_commands[] = 813 static const char * const ip_route_commands[] =
814 { "add", "append", "change", "chg", "delete", "del", "get", 814 { "add", "append", "change", "chg", "delete", "get",
815 "list", "show", "prepend", "replace", "test", "flush", 0 }; 815 "list", "show", "prepend", "replace", "test", "flush", 0 };
816 int command_num = 7; 816 int command_num = 6;
817 unsigned int flags = 0; 817 unsigned int flags = 0;
818 int cmd = RTM_NEWROUTE; 818 int cmd = RTM_NEWROUTE;
819 819
820 /* "Standard" 'ip r a' treats 'a' as 'add', not 'append' */
821 /* It probably means that it is using "first match" rule */
820 if (*argv) { 822 if (*argv) {
821 command_num = compare_string_array(ip_route_commands, *argv); 823 command_num = index_in_substr_array(ip_route_commands, *argv);
822 } 824 }
823 switch (command_num) { 825 switch (command_num) {
824 case 0: /* add*/ 826 case 0: /* add*/