Merge pull request #3113 from ssahani/route-fix
netwotkd: fix address and route conf
This commit is contained in:
@@ -67,16 +67,15 @@ int address_new_static(Network *network, unsigned section, Address **ret) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
address->network = network;
|
||||
|
||||
LIST_APPEND(addresses, network->static_addresses, address);
|
||||
|
||||
if (section) {
|
||||
address->section = section;
|
||||
hashmap_put(network->addresses_by_section,
|
||||
UINT_TO_PTR(address->section), address);
|
||||
}
|
||||
|
||||
address->network = network;
|
||||
LIST_APPEND(addresses, network->static_addresses, address);
|
||||
|
||||
*ret = address;
|
||||
address = NULL;
|
||||
|
||||
|
||||
@@ -68,15 +68,15 @@ int route_new_static(Network *network, unsigned section, Route **ret) {
|
||||
route->protocol = RTPROT_STATIC;
|
||||
|
||||
if (section) {
|
||||
route->section = section;
|
||||
|
||||
r = hashmap_put(network->routes_by_section, UINT_TO_PTR(route->section), route);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
route->section = section;
|
||||
}
|
||||
|
||||
LIST_PREPEND(routes, network->static_routes, route);
|
||||
route->network = network;
|
||||
LIST_PREPEND(routes, network->static_routes, route);
|
||||
|
||||
*ret = route;
|
||||
route = NULL;
|
||||
|
||||
Reference in New Issue
Block a user