return runIpRouteCommand(add ? ADD : DEL, table, interface, destination, nexthop);
}
+bool flushRoutes(const char* interface) {
+ uint32_t table = getRouteTableForInterface(interface);
+ if (!table) {
+ return false;
+ }
+
+ return runIpRouteCommand("flush", table, NULL, NULL, NULL);
+}
+
} // namespace
bool RouteController::createNetwork(unsigned netId, const char* interface, Permission permission) {
}
bool RouteController::destroyNetwork(unsigned netId, const char* interface, Permission permission) {
- return modifyPerNetworkRules(netId, interface, permission, false, true);
- // TODO: Flush the routing table.
+ return modifyPerNetworkRules(netId, interface, permission, false, true) &&
+ flushRoutes(interface);
}
bool RouteController::modifyNetworkPermission(unsigned netId, const char* interface,