OSDN Git Service

am 82eab785: Support legacy routes added by apps via ensureRouteToHost().
authorSreeram Ramachandran <sreeram@google.com>
Fri, 30 May 2014 21:33:07 +0000 (21:33 +0000)
committerAndroid Git Automerger <android-git-automerger@android.com>
Fri, 30 May 2014 21:33:07 +0000 (21:33 +0000)
* commit '82eab785bd5cb2eff0a263f5b0dcde13e9139588':
  Support legacy routes added by apps via ensureRouteToHost().

1  2 
server/RouteController.cpp

@@@ -32,15 -32,12 +32,19 @@@ const uint32_t RULE_PRIORITY_LEGAC
  const uint32_t RULE_PRIORITY_PER_NETWORK_NORMAL    = 17000;
  const uint32_t RULE_PRIORITY_DEFAULT_NETWORK       = 19000;
  const uint32_t RULE_PRIORITY_MAIN                  = 20000;
 +// TODO: Uncomment once we are sure everything works.
 +#if 0
  const uint32_t RULE_PRIORITY_UNREACHABLE           = 21000;
 +#endif
 +
 +// TODO: These should be turned into per-UID tables once the kernel supports UID-based routing.
 +const int ROUTE_TABLE_PRIVILEGED_LEGACY = RouteController::ROUTE_TABLE_OFFSET_FROM_INDEX - 901;
 +const int ROUTE_TABLE_LEGACY            = RouteController::ROUTE_TABLE_OFFSET_FROM_INDEX - 902;
  
+ // TODO: These should be turned into per-UID tables once the kernel supports UID-based routing.
+ const int ROUTE_TABLE_PRIVILEGED_LEGACY = RouteController::ROUTE_TABLE_OFFSET_FROM_INDEX - 901;
+ const int ROUTE_TABLE_LEGACY            = RouteController::ROUTE_TABLE_OFFSET_FROM_INDEX - 902;
  uint32_t getRouteTableForInterface(const char* interface) {
      uint32_t index = if_nametoindex(interface);
      return index ? index + RouteController::ROUTE_TABLE_OFFSET_FROM_INDEX : 0;