aboutsummaryrefslogtreecommitdiff
path: root/networking/libiproute/iproute.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-11-05 18:05:09 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-11-05 18:05:09 +0000
commit5af906e7c834301a0f237b50e1a1474ce0cf6da0 (patch)
tree8a5a2783a458269715a05dc48236cae8b1cb1ee0 /networking/libiproute/iproute.c
parent402151671b58b264f9c023e8e29615b3dc3c9acc (diff)
downloadbusybox-w32-5af906e7c834301a0f237b50e1a1474ce0cf6da0.tar.gz
busybox-w32-5af906e7c834301a0f237b50e1a1474ce0cf6da0.tar.bz2
busybox-w32-5af906e7c834301a0f237b50e1a1474ce0cf6da0.zip
rename: compare_string_array -> index_in_str_array
introduce index_in_substr_array and use it in iproute2
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*/