summaryrefslogtreecommitdiffstats
path: root/toolbox
diff options
context:
space:
mode:
authorDries Harnie <botje.linux@gmail.com>2010-01-18 17:44:33 +0100
committerDries Harnie <botje.linux@gmail.com>2010-07-15 13:19:37 +0200
commit2a743730c7d1a8adba8a922f7af46cef0b35363a (patch)
tree7ee44c18130dbac8313dc88e32f6bc408ddf2f80 /toolbox
parent07b3d09e841ea8544f72c3b2bf268f07df6357f7 (diff)
downloadsystem_core-2a743730c7d1a8adba8a922f7af46cef0b35363a.zip
system_core-2a743730c7d1a8adba8a922f7af46cef0b35363a.tar.gz
system_core-2a743730c7d1a8adba8a922f7af46cef0b35363a.tar.bz2
Userland support for VM interconnection
Change-Id: I699608f3072b39c8da1a7cc313bd0b736e90f225
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;
}
}