diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2010-07-29 15:04:57 -0700 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2010-07-29 15:04:57 -0700 |
commit | 0fcbdb4147858d40d581d3b034f5150962632943 (patch) | |
tree | f8d60bd03a6ff4d9f0efdded6448bf764fa76a4d /toolbox | |
parent | c37ba1c916d73fbf35c6faba1e252e2916d2d41d (diff) | |
parent | 2a743730c7d1a8adba8a922f7af46cef0b35363a (diff) | |
download | system_core-0fcbdb4147858d40d581d3b034f5150962632943.zip system_core-0fcbdb4147858d40d581d3b034f5150962632943.tar.gz system_core-0fcbdb4147858d40d581d3b034f5150962632943.tar.bz2 |
Merge "Userland support for VM interconnection"
Diffstat (limited to 'toolbox')
-rw-r--r-- | toolbox/Android.mk | 4 | ||||
-rw-r--r-- | toolbox/route.c | 24 |
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; } } |