summaryrefslogtreecommitdiff
path: root/server/RouteController.cpp
diff options
context:
space:
mode:
authorSreeram Ramachandran <sreeram@google.com>2014-06-27 06:42:11 -0700
committerSreeram Ramachandran <sreeram@google.com>2014-06-27 06:43:40 -0700
commit1077d298655efa7755925e788d49a73e9db10afc (patch)
treec746a1c40cb3516eac4c8903e904f0ff6c58b3fb /server/RouteController.cpp
parent72723683be57b6d562dc96cde30cc33cc96b3e82 (diff)
Don't fail when adding a duplicate legacy route.
This only affects calls to requestRouteToHost() by apps. We still fail if the framework itself tries to add a non-legacy duplicate route, since the framework should know better (we can consider relaxing that too in the future). Bug: 15925532 Change-Id: I9ee434277e462d570f88e6fe63a096e5ae41eee9
Diffstat (limited to 'server/RouteController.cpp')
-rw-r--r--server/RouteController.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/RouteController.cpp b/server/RouteController.cpp
index 51d90119..90a93992 100644
--- a/server/RouteController.cpp
+++ b/server/RouteController.cpp
@@ -392,7 +392,11 @@ int modifyRoute(const char* interface, const char* destination, const char* next
}
int ret = modifyIpRoute(action, table, interface, destination, nexthop);
- if (ret != 0) {
+ // We allow apps to call requestRouteToHost() multiple times with the same route, so ignore
+ // EEXIST failures when adding routes to legacy tables.
+ if (ret != 0 && !(action == RTM_NEWROUTE && ret == -EEXIST &&
+ (tableType == RouteController::LEGACY ||
+ tableType == RouteController::PRIVILEGED_LEGACY))) {
return ret;
}