blob: 2bdb6006a0f33db536320ae1c2048f8e613ef05c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
Subject: busybox 1.9.0 fixes
From: http://busybox.net/downloads/fixes-1.9.0
---
networking/libiproute/iproute.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Index: busybox-1.9.0/networking/libiproute/iproute.c
===================================================================
--- busybox-1.9.0.orig/networking/libiproute/iproute.c
+++ busybox-1.9.0/networking/libiproute/iproute.c
@@ -841,15 +841,17 @@ int do_iproute(char **argv)
/*0-3*/ "add\0""append\0""change\0""chg\0"
/*4-7*/ "delete\0""get\0""list\0""show\0"
/*8..*/ "prepend\0""replace\0""test\0""flush\0";
- int command_num = 6;
+ int command_num;
unsigned flags = 0;
int cmd = RTM_NEWROUTE;
+ if (!*argv)
+ return iproute_list_or_flush(argv, 0);
+
/* "Standard" 'ip r a' treats 'a' as 'add', not 'append' */
/* It probably means that it is using "first match" rule */
- if (*argv) {
- command_num = index_in_substrings(ip_route_commands, *argv);
- }
+ command_num = index_in_substrings(ip_route_commands, *argv);
+
switch (command_num) {
case 0: /* add */
flags = NLM_F_CREATE|NLM_F_EXCL;
|