From 7f0717e751930cd5da029c1852ff9f61f95e40b7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 23 Sep 2016 12:12:43 -0700 Subject: 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 Reviewed-by: Volker Lendecke --- source3/nmbd/nmbd_packets.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source3/nmbd') 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 -- cgit v1.2.1