diff options
Diffstat (limited to 'contrib/smbfs/lib/smb/nb.c')
-rw-r--r-- | contrib/smbfs/lib/smb/nb.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/smbfs/lib/smb/nb.c b/contrib/smbfs/lib/smb/nb.c index 2be9ab0..652a057 100644 --- a/contrib/smbfs/lib/smb/nb.c +++ b/contrib/smbfs/lib/smb/nb.c @@ -30,6 +30,7 @@ * SUCH DAMAGE. * * $Id: nb.c,v 1.4 2001/04/16 04:33:01 bp Exp $ + * $FreeBSD$ */ #include <sys/param.h> #include <sys/socket.h> @@ -57,6 +58,9 @@ nb_ctx_create(struct nb_ctx **ctxpp) if (ctx == NULL) return ENOMEM; bzero(ctx, sizeof(struct nb_ctx)); + ctx->nb_nmbtcpport = NMB_TCP_PORT; + ctx->nb_smbtcpport = SMB_TCP_PORT; + *ctxpp = ctx; return 0; } @@ -111,7 +115,7 @@ nb_ctx_resolve(struct nb_ctx *ctx) if (ctx->nb_nsname == NULL) { ctx->nb_ns.sin_addr.s_addr = htonl(INADDR_BROADCAST); } else { - error = nb_resolvehost_in(ctx->nb_nsname, &sap); + error = nb_resolvehost_in(ctx->nb_nsname, &sap, ctx->nb_smbtcpport); if (error) { smb_error("can't resolve %s", error, ctx->nb_nsname); return error; @@ -123,7 +127,7 @@ nb_ctx_resolve(struct nb_ctx *ctx) bcopy(sap, &ctx->nb_ns, sizeof(ctx->nb_ns)); free(sap); } - ctx->nb_ns.sin_port = htons(137); + ctx->nb_ns.sin_port = htons(ctx->nb_nmbtcpport); ctx->nb_ns.sin_family = AF_INET; ctx->nb_ns.sin_len = sizeof(ctx->nb_ns); ctx->nb_flags |= NBCF_RESOLVED; |