OSDN Git Service

Make legacy VPN work over stacked interfaces.
authorLorenzo Colitti <lorenzo@google.com>
Fri, 28 Jun 2013 08:26:21 +0000 (17:26 +0900)
committerLorenzo Colitti <lorenzo@google.com>
Tue, 30 Jul 2013 16:14:30 +0000 (01:14 +0900)
commitbc8f82fb1fc7485937fb2e542ebe6ae1ddd2e0d7
tree031d318557ffd63cc234b20165df59537a81738b
parentefa73c05f7fb0bc8bf9a50604d5c2f65a1a68697
Make legacy VPN work over stacked interfaces.

On stacked interfaces like 464xlat, Legacy VPN can't find the
default gateway because it uses getRoutes, which only returns
routes for the base link and not for the stacked links. It also
assumes that the interface that the default route points to is
the interface for the base link (e.g., rmnet0) instead of the
interface the route actually points to (e.g., clat4).

Fix this by calling getAllRoutes to find the default IPv4 route,
and get the interface name from the route we find instead of
assuming it's the base interface.

Bug: 9597516
Change-Id: Ia6ce0b6258a421cd22f60dedca7e94176b32176b
services/java/com/android/server/connectivity/Vpn.java