Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/apache2/mDNSResponder/dist/mDNSPosix zero out socke...
details: https://anonhg.NetBSD.org/src/rev/59d21ec040ac
branches: trunk
changeset: 359796:59d21ec040ac
user: christos <christos%NetBSD.org@localhost>
date: Sun Feb 25 19:22:41 2018 +0000
description:
zero out socket structures before bind.
diffstat:
external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diffs (36 lines):
diff -r a0e7808ad156 -r 59d21ec040ac external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c
--- a/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c Sun Feb 25 18:55:23 2018 +0000
+++ b/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c Sun Feb 25 19:22:41 2018 +0000
@@ -745,6 +745,10 @@
// And start listening for packets
if (err == 0)
{
+ mDNSPlatformMemZero(&bindAddr, sizeof(bindAddr));
+#ifndef NOT_HAVE_SA_LEN
+ bindAddr.sin_len = sizeof(bindAddr);
+#endif
bindAddr.sin_family = AF_INET;
bindAddr.sin_port = port.NotAnInteger;
bindAddr.sin_addr.s_addr = INADDR_ANY; // Want to receive multicasts AND unicasts on this socket
@@ -1054,6 +1058,9 @@
/* Subscribe the socket to Link & IP addr notifications. */
mDNSPlatformMemZero(&snl, sizeof snl);
+#ifndef NOT_HAVE_SA_LEN
+ snl.nl_len = sizeof(snl);
+#endif
snl.nl_family = AF_NETLINK;
snl.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR;
ret = bind(sock, (struct sockaddr *) &snl, sizeof snl);
@@ -1266,6 +1273,11 @@
int err;
int s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
struct sockaddr_in s5353;
+
+ mDNSPlatformMemZero(&s5353, sizeof(s5353));
+#ifndef NOT_HAVE_SA_LEN
+ s5353.sin_len = sizeof(s5353);
+#endif
s5353.sin_family = AF_INET;
s5353.sin_port = MulticastDNSPort.NotAnInteger;
s5353.sin_addr.s_addr = 0;
Home |
Main Index |
Thread Index |
Old Index