OSDN Git Service

Stop creating a symlink for route.
authorElliott Hughes <enh@google.com>
Fri, 15 Apr 2016 18:57:05 +0000 (11:57 -0700)
committerElliott Hughes <enh@google.com>
Fri, 15 Apr 2016 18:57:05 +0000 (11:57 -0700)
commit1c2326b8af500adbb5864ea87afa94a0c6cf1ff0
treec08642ec54b15f83fdfe50a506d9ed4e443583e6
parenta898e9c4b457765173a0ec6adea26d45b70b744c
Stop creating a symlink for route.

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

This is a first step. If no device breaks, I'll stop building it too. In the
meantime, it's still available as "toybox route".

Bug: http://b/27603033
Change-Id: Ie444bfa9083e1f11b332d5d050a07cec48436e11
Android.mk