summaryrefslogtreecommitdiffstats
path: root/toolbox
diff options
context:
space:
mode:
Diffstat (limited to 'toolbox')
-rw-r--r--toolbox/Android.mk4
-rw-r--r--toolbox/route.c24
2 files changed, 19 insertions, 9 deletions
diff --git a/toolbox/Android.mk b/toolbox/Android.mk
index 05b2a34..58937cf 100644
--- a/toolbox/Android.mk
+++ b/toolbox/Android.mk
@@ -41,7 +41,7 @@ TOOLS := \
printenv \
smd \
chmod \
- chown \
+ chown \
newfs_msdos \
netstat \
ioctl \
@@ -53,7 +53,7 @@ TOOLS := \
uptime \
vmstat \
nandread \
- ionice
+ ionice
LOCAL_SRC_FILES:= \
toolbox.c \
diff --git a/toolbox/route.c b/toolbox/route.c
index 107e48a..3e10014 100644
--- a/toolbox/route.c
+++ b/toolbox/route.c
@@ -80,14 +80,24 @@ int route_main(int argc, char *argv[])
/* route add -net 192.168.1.2 netmask 255.255.255.0 gw 192.168.1.1 */
if (argc > 7 && !strcmp(argv[2], "-net") &&
- !strcmp(argv[4], "netmask") && !strcmp(argv[6], "gw")) {
- rt.rt_flags = RTF_UP | RTF_GATEWAY;
- if (set_address(argv[3], &rt.rt_dst) &&
- set_address(argv[5], &rt.rt_genmask) &&
- set_address(argv[7], &rt.rt_gateway)) {
- errno = 0;
+ !strcmp(argv[4], "netmask")) {
+ if (!strcmp(argv[6], "gw")) {
+ rt.rt_flags = RTF_UP | RTF_GATEWAY;
+ if (set_address(argv[3], &rt.rt_dst) &&
+ set_address(argv[5], &rt.rt_genmask) &&
+ set_address(argv[7], &rt.rt_gateway)) {
+ errno = 0;
+ }
+ goto apply;
+ } else if (!strcmp(argv[6], "dev")) {
+ rt.rt_flags = RTF_UP;
+ rt.rt_dev = argv[7];
+ if (set_address(argv[3], &rt.rt_dst) &&
+ set_address(argv[5], &rt.rt_genmask)) {
+ errno = 0;
+ }
+ goto apply;
}
- goto apply;
}
}