From 65379ef3a44972698fd64905edfbb8865b338df8 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 1 Mar 2015 20:04:00 +1300 Subject: [PATCH] param: Use IDL-based constants for NBT and NBT dgram ports Signed-off-by: Andrew Bartlett Reviewed-by: Jelmer Vernooij Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Mon Mar 16 05:35:56 CET 2015 on sn-devel-104 --- lib/param/loadparm.c | 5 +++-- source3/param/loadparm.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c index e83d72503dd..c619ad2a3a8 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -67,6 +67,7 @@ #include "lib/util/bitmap.h" #include "libcli/smb/smb_constants.h" #include "tdb.h" +#include "librpc/gen_ndr/nbt.h" #define standard_sub_basic talloc_strdup @@ -2532,8 +2533,8 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx) lpcfg_do_global_parameter(lp_ctx, "use mmap", "True"); lpcfg_do_global_parameter(lp_ctx, "smb ports", "445 139"); - lpcfg_do_global_parameter(lp_ctx, "nbt port", "137"); - lpcfg_do_global_parameter(lp_ctx, "dgram port", "138"); + lpcfg_do_global_parameter_var(lp_ctx, "nbt port", "%d", NBT_NAME_SERVICE_PORT); + lpcfg_do_global_parameter_var(lp_ctx, "dgram port", "%d", NBT_DGRAM_SERVICE_PORT); lpcfg_do_global_parameter(lp_ctx, "cldap port", "389"); lpcfg_do_global_parameter(lp_ctx, "krb5 port", "88"); lpcfg_do_global_parameter(lp_ctx, "kpasswd port", "464"); diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4a7484349f6..a6b3b45f949 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -69,6 +69,7 @@ #include "dbwrap/dbwrap.h" #include "dbwrap/dbwrap_rbt.h" #include "../lib/util/bitmap.h" +#include "librpc/gen_ndr/nbt.h" #ifdef HAVE_SYS_SYSCTL_H #include @@ -907,9 +908,9 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals) Globals.cldap_port = 389; - Globals.dgram_port = 138; + Globals.dgram_port = NBT_DGRAM_SERVICE_PORT; - Globals.nbt_port = 137; + Globals.nbt_port = NBT_NAME_SERVICE_PORT; Globals.krb5_port = 88; -- 2.11.4.GIT