1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 02:21:44 +03:00

network: add assertions

As they do not have default callback functions.
This commit is contained in:
Yu Watanabe 2018-11-28 21:29:09 +01:00
parent 4645ad47ac
commit bd1175bc46
2 changed files with 2 additions and 0 deletions

View File

@ -570,6 +570,7 @@ int address_configure(
assert(link->ifindex > 0);
assert(link->manager);
assert(link->manager->rtnl);
assert(callback);
/* If this is a new address, then refuse adding more than the limit */
if (address_get(link, address->family, &address->in_addr, address->prefixlen, NULL) <= 0 &&

View File

@ -513,6 +513,7 @@ int route_configure(
assert(link->manager->rtnl);
assert(link->ifindex > 0);
assert(IN_SET(route->family, AF_INET, AF_INET6));
assert(callback);
if (route_get(link, route->family, &route->dst, route->dst_prefixlen, route->tos, route->priority, route->table, NULL) <= 0 &&
set_size(link->routes) >= routes_max())