]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/in-addr-util.c
tree-wide: Convert compare_func's to use CMP() macro wherever possible.
[thirdparty/systemd.git] / src / basic / in-addr-util.c
index a21aa149f558ccd8469c42434ca6c567d8bc0d56..d83658eaa701ab2a174ea7ee05df80870fa4d4de 100644 (file)
@@ -581,9 +581,11 @@ void in_addr_data_hash_func(const void *p, struct siphash *state) {
 
 int in_addr_data_compare_func(const void *a, const void *b) {
         const struct in_addr_data *x = a, *y = b;
+        int r;
 
-        if (x->family != y->family)
-                return x->family - y->family;
+        r = CMP(x->family, y->family);
+        if (r != 0)
+                return r;
 
         return memcmp(&x->address, &y->address, FAMILY_ADDRESS_SIZE(x->family));
 }