summaryrefslogtreecommitdiff
path: root/networking/libiproute
diff options
context:
space:
mode:
authorDenis Vlasenko2007-01-27 13:13:45 +0000
committerDenis Vlasenko2007-01-27 13:13:45 +0000
commitfd94efa41f6a37221c68d4c0ed12f4883d2069ba (patch)
tree8e00850c00211ca8a33bf1317358a9ad9a3627d1 /networking/libiproute
parent5ff8f3d7fde54075936e82b5075bb551f1ea37d6 (diff)
downloadbusybox-fd94efa41f6a37221c68d4c0ed12f4883d2069ba.zip
busybox-fd94efa41f6a37221c68d4c0ed12f4883d2069ba.tar.gz
fix numbering in switch(): we don't have "del" anymore,
substring match on "delete" handles it ok. But we (I?) forgot to renumber case labels...
Diffstat (limited to 'networking/libiproute')
-rw-r--r--networking/libiproute/iproute.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index c4c3fc2..c8a58c1 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -835,9 +835,11 @@ 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", "get",
- "list", "show", "prepend", "replace", "test", "flush", 0 };
+ static const char * const ip_route_commands[] = {
+ /*0-3*/ "add", "append", "change", "chg",
+ /*4-7*/ "delete", "get", "list", "show",
+ /*8..*/ "prepend", "replace", "test", "flush", 0
+ };
int command_num = 6;
unsigned int flags = 0;
int cmd = RTM_NEWROUTE;
@@ -848,7 +850,7 @@ int do_iproute(int argc, char **argv)
command_num = index_in_substr_array(ip_route_commands, *argv);
}
switch (command_num) {
- case 0: /* add*/
+ case 0: /* add */
flags = NLM_F_CREATE|NLM_F_EXCL;
break;
case 1: /* append */
@@ -859,21 +861,20 @@ int do_iproute(int argc, char **argv)
flags = NLM_F_REPLACE;
break;
case 4: /* delete */
- case 5: /* del */
cmd = RTM_DELROUTE;
break;
- case 6: /* get */
+ case 5: /* get */
return iproute_get(argc-1, argv+1);
- case 7: /* list */
- case 8: /* show */
+ case 6: /* list */
+ case 7: /* show */
return iproute_list_or_flush(argc-1, argv+1, 0);
- case 9: /* prepend */
+ case 8: /* prepend */
flags = NLM_F_CREATE;
- case 10: /* replace */
+ case 9: /* replace */
flags = NLM_F_CREATE|NLM_F_REPLACE;
- case 11: /* test */
+ case 10: /* test */
flags = NLM_F_EXCL;
- case 12: /* flush */
+ case 11: /* flush */
return iproute_list_or_flush(argc-1, argv+1, 1);
default:
bb_error_msg_and_die("unknown command %s", *argv);