From: Stefan Metzmacher Date: Thu, 21 Dec 2023 12:02:43 +0000 (+0100) Subject: lib/util: let is_zero_addr() return true for AF_UNSPEC X-Git-Tag: talloc-2.4.2~128 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d52f7279063817055b6816d9f8372e374c90f75f;p=thirdparty%2Fsamba.git lib/util: let is_zero_addr() return true for AF_UNSPEC It means the completely zero'ed structure is detected as zero address, as AF_UNSPEC is 0. Signed-off-by: Stefan Metzmacher Reviewed-by: Günther Deschner Reviewed-by: Andreas Schneider --- diff --git a/lib/util/util_net.c b/lib/util/util_net.c index acaa76ea74e..48c9552558b 100644 --- a/lib/util/util_net.c +++ b/lib/util/util_net.c @@ -642,6 +642,9 @@ bool is_zero_addr(const struct sockaddr_storage *pss) const struct in_addr *pin = &((const struct sockaddr_in *)pss)->sin_addr; return is_zero_ip_v4(*pin); } + if (pss->ss_family == AF_UNSPEC) { + return true; + } return false; }