summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-09-23 12:12:43 -0700
committerKarolin Seeger <kseeger@samba.org>2016-10-20 10:43:27 +0200
commit0918f181c5a333cfa29fd485f60045109d3d2f81 (patch)
tree6e3c5aa4e4d1e62cebee5f5a13e05d8aef60a310
parent447b640638d616bb39916b55191a5f22a90d4e43 (diff)
downloadsamba-0918f181c5a333cfa29fd485f60045109d3d2f81.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> (cherry picked from commit 7f0717e751930cd5da029c1852ff9f61f95e40b7)
-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 ddbc2a0efdc..1b59d6bcdf4 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