]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: use in6_addr_hash_ops
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 18 May 2019 03:29:40 +0000 (12:29 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 18 May 2019 03:29:40 +0000 (12:29 +0900)
src/network/networkd-manager.c

index 1af25dc812c6275acfbaedfe46987348df5befd0..de177e6d1abfa9e80d72a4eed5f519fbc97ec3c1 100644 (file)
@@ -1264,18 +1264,6 @@ static int dhcp6_route_add_handler(sd_netlink *nl, sd_netlink_message *m, Link *
         return 0;
 }
 
-static void dhcp6_prefixes_hash_func(const struct in6_addr *addr, struct siphash *state) {
-        assert(addr);
-
-        siphash24_compress(addr, sizeof(*addr), state);
-}
-
-static int dhcp6_prefixes_compare_func(const struct in6_addr *a, const struct in6_addr *b) {
-        return memcmp(a, b, sizeof(*a));
-}
-
-DEFINE_PRIVATE_HASH_OPS(dhcp6_prefixes_hash_ops, struct in6_addr, dhcp6_prefixes_hash_func, dhcp6_prefixes_compare_func);
-
 int manager_dhcp6_prefix_add(Manager *m, struct in6_addr *addr, Link *link) {
         _cleanup_free_ struct in6_addr *a = NULL;
         _cleanup_free_ char *buf = NULL;
@@ -1308,7 +1296,7 @@ int manager_dhcp6_prefix_add(Manager *m, struct in6_addr *addr, Link *link) {
         if (!a)
                 return -ENOMEM;
 
-        r = hashmap_ensure_allocated(&m->dhcp6_prefixes, &dhcp6_prefixes_hash_ops);
+        r = hashmap_ensure_allocated(&m->dhcp6_prefixes, &in6_addr_hash_ops);
         if (r < 0)
                 return r;