From: Yu Watanabe Date: Tue, 6 Feb 2018 08:05:58 +0000 (+0900) Subject: networkd: fix dhcp6_prefixes_compare_func() X-Git-Tag: v238~140^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa18944d392f2b1894d1272767ad047be5352f99;p=thirdparty%2Fsystemd.git networkd: fix dhcp6_prefixes_compare_func() Found by the following warning by gcc. ``` ../src/network/networkd-manager.c: In function 'dhcp6_prefixes_compare_func': ../src/network/networkd-manager.c:1383:16: warning: 'memcmp' reading 16 bytes from a region of size 8 [-Wstringop-overflow=] return memcmp(&a, &b, sizeof(*a)); ^ ``` --- diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index 749b87f336d..4f55c0172f7 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -1380,7 +1380,7 @@ static void dhcp6_prefixes_hash_func(const void *p, struct siphash *state) { static int dhcp6_prefixes_compare_func(const void *_a, const void *_b) { const struct in6_addr *a = _a, *b = _b; - return memcmp(&a, &b, sizeof(*a)); + return memcmp(a, b, sizeof(*a)); } static const struct hash_ops dhcp6_prefixes_hash_ops = {