From 2a743730c7d1a8adba8a922f7af46cef0b35363a Mon Sep 17 00:00:00 2001 From: Dries Harnie Date: Mon, 18 Jan 2010 17:44:33 +0100 Subject: Userland support for VM interconnection Change-Id: I699608f3072b39c8da1a7cc313bd0b736e90f225 --- toolbox/Android.mk | 4 ++-- toolbox/route.c | 24 +++++++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) (limited to 'toolbox') 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; } } -- cgit v1.1