summaryrefslogtreecommitdiff
path: root/source3/nmbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-09-23 12:12:43 -0700
committerVolker Lendecke <vl@samba.org>2016-09-24 19:52:08 +0200
commit7f0717e751930cd5da029c1852ff9f61f95e40b7 (patch)
treecdbc2b5507455ba9e8381a16e467dd756b060edb /source3/nmbd
parentd8ade0730797df22bfe28847e034eb6d116b0e00 (diff)
downloadsamba-7f0717e751930cd5da029c1852ff9f61f95e40b7.tar.gz
s3: nmbd: Ensure attrs array mirrors fd's array for dns.
This will allow us to eventually remove source3/lib/events.c dependency and make nmbd purely tevent based. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12283 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/nmbd')
-rw-r--r--source3/nmbd/nmbd_packets.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c
index 619cc9a095a..26486797de7 100644
--- a/source3/nmbd/nmbd_packets.c
+++ b/source3/nmbd/nmbd_packets.c
@@ -1919,8 +1919,23 @@ bool listen_for_packets(struct messaging_context *msg, bool run_election)
if (fds == NULL) {
return true;
}
+ attrs = talloc_realloc(NULL,
+ attrs,
+ struct socket_attributes,
+ num_sockets + 1);
+ if (attrs == NULL) {
+ TALLOC_FREE(fds);
+ return true;
+ }
dns_pollidx = num_sockets;
fds[num_sockets].fd = dns_fd;
+ attrs[dns_pollidx].fd = dns_fd;
+ /*
+ * dummy values, we only need
+ * fd and triggered.
+ */
+ attrs[dns_pollidx].type = NMB_PACKET;
+ attrs[dns_pollidx].broadcast = false;
num_sockets += 1;
}
#endif