s3: Pass messaging_context to nmbd/process()
[kai/samba.git] / source3 / nmbd / nmbd.c
index 7dff92a502a1e77abd6ea86d091918d81b9bdf3a..8c41ebbde6e9e34518e458217c35014fafa4610f 100644 (file)
@@ -47,7 +47,7 @@ struct event_context *nmbd_event_context(void)
        return server_event_context();
 }
 
-struct messaging_context *nmbd_messaging_context(void)
+static struct messaging_context *nmbd_messaging_context(void)
 {
        struct messaging_context *msg_ctx = server_messaging_context();
        if (likely(msg_ctx != NULL)) {
@@ -459,7 +459,7 @@ static void msg_nmbd_send_packet(struct messaging_context *msg,
  The main select loop.
  **************************************************************************** */
 
-static void process(void)
+static void process(struct messaging_context *msg)
 {
        bool run_election;
 
@@ -480,7 +480,7 @@ static void process(void)
                 * (nmbd_packets.c)
                 */
 
-               if(listen_for_packets(run_election)) {
+               if (listen_for_packets(msg, run_election)) {
                        TALLOC_FREE(frame);
                        return;
                }
@@ -905,7 +905,7 @@ static bool open_sockets(bool isdaemon, int port)
        /* Setup the async dns. We do it here so it doesn't have all the other
                stuff initialised and thus chewing memory and sockets */
        if(lp_we_are_a_wins_server() && lp_dns_proxy()) {
-               start_async_dns();
+               start_async_dns(nmbd_messaging_context());
        }
 #endif
 
@@ -1012,7 +1012,7 @@ static bool open_sockets(bool isdaemon, int port)
         }
 
        TALLOC_FREE(frame);
-       process();
+       process(nmbd_messaging_context());
 
        kill_async_dns_child();
        return(0);