diff options
author | Tom Gundersen <teg@jklm.no> | 2014-07-28 12:21:51 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-07-28 12:21:51 +0200 |
commit | 16aa63a00b5b1db23a9c0b8de350ebf482d90cd0 (patch) | |
tree | c6284cb5d0d56d0d2ec61138da8de37fdd97e076 /src/network/networkd-route.c | |
parent | 6a0a2f860f1ca4a10932da3b41dbc3c0139757cc (diff) |
networkd: route/address - use trivial hash functions
Diffstat (limited to 'src/network/networkd-route.c')
-rw-r--r-- | src/network/networkd-route.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 00fd9528c4..f451b975a7 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -32,9 +32,8 @@ int route_new_static(Network *network, unsigned section, Route **ret) { _cleanup_route_free_ Route *route = NULL; if (section) { - uint64_t key = section; - - route = hashmap_get(network->routes_by_section, &key); + route = hashmap_get(network->routes_by_section, + UINT_TO_PTR(section)); if (route) { *ret = route; route = NULL; @@ -57,7 +56,8 @@ int route_new_static(Network *network, unsigned section, Route **ret) { if (section) { route->section = section; - hashmap_put(network->routes_by_section, &route->section, route); + hashmap_put(network->routes_by_section, + UINT_TO_PTR(route->section), route); } *ret = route; @@ -92,7 +92,7 @@ void route_free(Route *route) { if (route->section) hashmap_remove(route->network->routes_by_section, - &route->section); + UINT_TO_PTR(route->section)); } free(route); |