summaryrefslogtreecommitdiff
path: root/src/network/networkd-address.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-07-28 12:21:51 +0200
committerTom Gundersen <teg@jklm.no>2014-07-28 12:21:51 +0200
commit16aa63a00b5b1db23a9c0b8de350ebf482d90cd0 (patch)
treec6284cb5d0d56d0d2ec61138da8de37fdd97e076 /src/network/networkd-address.c
parent6a0a2f860f1ca4a10932da3b41dbc3c0139757cc (diff)
networkd: route/address - use trivial hash functions
Diffstat (limited to 'src/network/networkd-address.c')
-rw-r--r--src/network/networkd-address.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index 551c1ea9bf..539bd98b52 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -41,8 +41,7 @@ int address_new_static(Network *network, unsigned section, Address **ret) {
_cleanup_address_free_ Address *address = NULL;
if (section) {
- uint64_t key = section;
- address = hashmap_get(network->addresses_by_section, &key);
+ address = hashmap_get(network->addresses_by_section, UINT_TO_PTR(section));
if (address) {
*ret = address;
address = NULL;
@@ -63,7 +62,8 @@ int address_new_static(Network *network, unsigned section, Address **ret) {
if (section) {
address->section = section;
- hashmap_put(network->addresses_by_section, &address->section, address);
+ hashmap_put(network->addresses_by_section,
+ UINT_TO_PTR(address->section), address);
}
*ret = address;
@@ -96,7 +96,7 @@ void address_free(Address *address) {
if (address->section)
hashmap_remove(address->network->addresses_by_section,
- &address->section);
+ UINT_TO_PTR(address->section));
}
free(address);