From 48e1f81151f6f73d6bbd9c69c1224e60863609fb Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 25 May 2016 14:47:37 -0700 Subject: [PATCH] Stop building toybox route. From the commit that stopped creating the symlink: We should remove the "route" command because its output is irrelevant and misleading. This is because it only looks at the "main" routing table, which is a last resort routing table that is a) trumped by all other networks, b) empty except for directly-connected routes c) cannot even be used by non-root users. The proper way to understand device routing is to look at the output of "ip rule" and "ip route", both of which are already available. Example of how this is confusing: $ adb shell route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 160.249.218.72 * 255.255.255.248 U 0 0 0 rmnet_data0 192.168.144.0 * 255.255.240.0 U 0 0 0 wlan0 These aren't guaranteed to be used. For example, according to the output above 160.249.218.73 should go through rmnet_data0, but it doesn't: $ adb shell ip route get 160.249.218.73 160.249.218.73 via 192.168.159.254 dev wlan0 src 192.168.159.164 uid 0 cache Also, there is no default route. But the device has networking just fine: $ adb shell ip route get 8.8.8.8 8.8.8.8 via 192.168.159.254 dev wlan0 src 192.168.159.164 uid 0 cache Bug: http://b/27603033 Change-Id: I40be0a7e2841144797a67f9aeb82b9097cec5400 --- .config | 2 +- Android.mk | 1 - generated/config.h | 4 ++-- generated/flags.h | 10 +++++----- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.config b/.config index aeea8aa4..db28cb2f 100644 --- a/.config +++ b/.config @@ -169,7 +169,7 @@ CONFIG_PGREP=y CONFIG_PKILL=y # CONFIG_PING is not set # CONFIG_RESET is not set -CONFIG_ROUTE=y +# CONFIG_ROUTE is not set # CONFIG_SH is not set # CONFIG_EXIT is not set # CONFIG_CD is not set diff --git a/Android.mk b/Android.mk index 8833d2ef..fdf76f6c 100644 --- a/Android.mk +++ b/Android.mk @@ -139,7 +139,6 @@ LOCAL_SRC_FILES := \ toys/pending/lsof.c \ toys/pending/more.c \ toys/pending/netstat.c \ - toys/pending/route.c \ toys/pending/tar.c \ toys/pending/tr.c \ toys/pending/traceroute.c \ diff --git a/generated/config.h b/generated/config.h index 27e216b8..4f346fc5 100644 --- a/generated/config.h +++ b/generated/config.h @@ -316,8 +316,8 @@ #define USE_PING(...) #define CFG_RESET 0 #define USE_RESET(...) -#define CFG_ROUTE 1 -#define USE_ROUTE(...) __VA_ARGS__ +#define CFG_ROUTE 0 +#define USE_ROUTE(...) #define CFG_SH 0 #define USE_SH(...) #define CFG_EXIT 0 diff --git a/generated/flags.h b/generated/flags.h index 7f62f3b0..c75abbe2 100644 --- a/generated/flags.h +++ b/generated/flags.h @@ -2093,9 +2093,9 @@ #undef FLAG_w #endif -// route ?neA: ?neA: +// route ?neA: #undef OPTSTR_route -#define OPTSTR_route "?neA:" +#define OPTSTR_route 0 #ifdef CLEANUP_route #undef CLEANUP_route #undef FOR_route @@ -4820,9 +4820,9 @@ #ifndef TT #define TT this.route #endif -#define FLAG_A (1<<0) -#define FLAG_e (1<<1) -#define FLAG_n (1<<2) +#define FLAG_A (FORCED_FLAG<<0) +#define FLAG_e (FORCED_FLAG<<1) +#define FLAG_n (FORCED_FLAG<<2) #endif #ifdef FOR_runcon -- 2.11.0