Finish removal of iconv_convenience in public API's.
[bbaumbach/samba-autobuild/.git] / source4 / nbt_server / dgram / request.c
index bea1e84213897b276e8a71fab6ae1f858fbe5c07..4a3bd133685558ca653465085b284cf7d326a6a7 100644 (file)
@@ -26,6 +26,7 @@
 #include "libcli/resolve/resolve.h"
 #include "nbt_server/dgram/proto.h"
 #include "librpc/gen_ndr/ndr_nbt.h"
+#include "param/param.h"
 
 /*
   a list of mailslots that we have static handlers for
@@ -34,8 +35,10 @@ static const struct {
        const char *mailslot_name;
        dgram_mailslot_handler_t handler;
 } mailslot_handlers[] = {
+       /* Handle both NTLOGON and NETLOGON in the same function, as
+        * they are very similar */
        { NBT_MAILSLOT_NETLOGON, nbtd_mailslot_netlogon_handler },
-       { NBT_MAILSLOT_NTLOGON,  nbtd_mailslot_ntlogon_handler },
+       { NBT_MAILSLOT_NTLOGON,  nbtd_mailslot_netlogon_handler },
        { NBT_MAILSLOT_BROWSE,   nbtd_mailslot_browse_handler }
 };
 
@@ -79,7 +82,8 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address
                }
        
                bcast_addr = socket_address_from_strings(tmp_ctx, bcast_dgmsock->sock->backend_name, 
-                                                        iface->bcast_address, lp_dgram_port());
+                                                        iface->bcast_address, 
+                                                        lp_dgram_port(iface->nbtsrv->task->lp_ctx));
                if (!bcast_addr) {
                        talloc_free(tmp_ctx);
                        return NT_STATUS_NO_MEMORY;
@@ -89,7 +93,8 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address
                if (!NT_STATUS_IS_OK(status)) {
                        talloc_free(tmp_ctx);
                        DEBUG(0,("Failed to bind to %s:%d - %s\n", 
-                                iface->bcast_address, lp_dgram_port(), nt_errstr(status)));
+                                iface->bcast_address, lp_dgram_port(iface->nbtsrv->task->lp_ctx), 
+                                nt_errstr(status)));
                        return status;
                }
        
@@ -104,7 +109,7 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address
        }
 
        bind_addr = socket_address_from_strings(tmp_ctx, iface->dgmsock->sock->backend_name, 
-                                               bind_address, lp_dgram_port());
+                                               bind_address, lp_dgram_port(iface->nbtsrv->task->lp_ctx));
        if (!bind_addr) {
                talloc_free(tmp_ctx);
                return NT_STATUS_NO_MEMORY;
@@ -114,7 +119,7 @@ NTSTATUS nbtd_dgram_setup(struct nbtd_interface *iface, const char *bind_address
        if (!NT_STATUS_IS_OK(status)) {
                talloc_free(tmp_ctx);
                DEBUG(0,("Failed to bind to %s:%d - %s\n", 
-                        bind_address, lp_dgram_port(), nt_errstr(status)));
+                        bind_address, lp_dgram_port(iface->nbtsrv->task->lp_ctx), nt_errstr(status)));
                return status;
        }