Index: ctx.c =================================================================== RCS file: /home/ncvs/src/contrib/smbfs/lib/smb/ctx.c,v retrieving revision 1.7 diff -u -p -r1.7 ctx.c --- ctx.c 2 Oct 2005 08:32:48 -0000 1.7 +++ ctx.c 3 Dec 2005 06:35:09 -0000 @@ -547,6 +547,22 @@ smb_ctx_resolve(struct smb_ctx *ctx) (ssn->ioc_servercs, ssn->ioc_localcs); if (error) return error; } + if (inet_aton(ssn->ioc_srvname, NULL) == 0) { + strcpy(nn.nn_name, ssn->ioc_srvname); + } else { + /* + * Using IP address as server name, replace it with + * *SMBSERVER for Windows 2000/XP compatibility. + */ + strcpy(nn.nn_name, "*SMBSERVER"); + + /* + * if there is no server address available, use the same IP + * address as well + */ + if (ctx->ct_srvaddr == NULL) + smb_ctx_setsrvaddr(ctx, ssn->ioc_srvname); + } if (ctx->ct_srvaddr) { error = nb_resolvehost_in(ctx->ct_srvaddr, &sap, ctx->ct_smbtcpport); } else { @@ -558,7 +574,6 @@ smb_ctx_resolve(struct smb_ctx *ctx) } nn.nn_scope = ctx->ct_nb->nb_scope; nn.nn_type = NBT_SERVER; - strcpy(nn.nn_name, ssn->ioc_srvname); error = nb_sockaddr(sap, &nn, &saserver); nb_snbfree(sap); if (error) {