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-5af906e7c834301a0f237b50e1a1474ce0cf6da0.tar.gz
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)
req.r.rtm_tos = 0;
while (argc > 0) {
- switch (compare_string_array(options, *argv)) {
+ switch (index_in_str_array(options, *argv)) {
case 0: /* from */
{
inet_prefix addr;
@@ -811,14 +811,16 @@ static int iproute_get(int argc, char **argv)
int do_iproute(int argc, char **argv)
{
static const char * const ip_route_commands[] =
- { "add", "append", "change", "chg", "delete", "del", "get",
+ { "add", "append", "change", "chg", "delete", "get",
"list", "show", "prepend", "replace", "test", "flush", 0 };
- int command_num = 7;
+ int command_num = 6;
unsigned int flags = 0;
int cmd = RTM_NEWROUTE;
+ /* "Standard" 'ip r a' treats 'a' as 'add', not 'append' */
+ /* It probably means that it is using "first match" rule */
if (*argv) {
- command_num = compare_string_array(ip_route_commands, *argv);
+ command_num = index_in_substr_array(ip_route_commands, *argv);
}
switch (command_num) {
case 0: /* add*/