git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
10b084f
)
lib/util: let is_zero_addr() return true for AF_UNSPEC
author
Stefan Metzmacher
<metze@samba.org>
Thu, 21 Dec 2023 12:02:43 +0000
(13:02 +0100)
committer
Stefan Metzmacher
<metze@samba.org>
Tue, 9 Jan 2024 10:21:34 +0000
(10:21 +0000)
It means the completely zero'ed structure is detected
as zero address, as AF_UNSPEC is 0.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/util/util_net.c
patch
|
blob
|
history
diff --git
a/lib/util/util_net.c
b/lib/util/util_net.c
index acaa76ea74eef437f0a33802459987e09877e4a1..48c9552558b9d6df847244d11d8e3bf53212cced 100644
(file)
--- 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;
}