kernel-pfroute: Don't cache route entries if installation fails

This commit is contained in:
Tobias Brunner
2014-02-12 13:52:25 +01:00
parent f0f78b74d4
commit 822b22c96f
@@ -1420,9 +1420,12 @@ METHOD(kernel_net_t, add_route, status_t,
this->routes_lock->unlock(this->routes_lock);
return ALREADY_DONE;
}
found = route_entry_clone(&route);
this->routes->put(this->routes, found, found);
status = manage_route(this, RTM_ADD, dst_net, prefixlen, gateway, if_name);
if (status == SUCCESS)
{
found = route_entry_clone(&route);
this->routes->put(this->routes, found, found);
}
this->routes_lock->unlock(this->routes_lock);
return status;
}