summaryrefslogtreecommitdiff
path: root/source4/nbt_server/register.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-02-08 01:09:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:36 -0500
commit998c856d9005cd8e1111a939db6fa7b25196b766 (patch)
treecc562247c591a12fbad4d9fce76c7e816636d511 /source4/nbt_server/register.c
parent2513ac33de03e4c92f6d4a10595db44700971bb8 (diff)
downloadsamba-998c856d9005cd8e1111a939db6fa7b25196b766.tar.gz
samba-998c856d9005cd8e1111a939db6fa7b25196b766.tar.bz2
samba-998c856d9005cd8e1111a939db6fa7b25196b766.zip
r5276: - added support for NBT_OPCODE_REFRESH2 (type 0x9)
- when registering with a WINS server, initially use multi-homed registration, then switch to name refresh requests. Send refresh requests only to the WINS server that responded to our registration. If that server goes away, then start the registration from scratch. This makes registration more robust to WINS server failure. - send WINS registration requests out on our first interface rather than an unbound interface, to avoid the problem of WACK replies being sent to the wrong port (w2k3 WINS server does this) (This used to be commit f7712ac7468184c07b3e3c10cb7b847ad1791dd2)
Diffstat (limited to 'source4/nbt_server/register.c')
-rw-r--r--source4/nbt_server/register.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/nbt_server/register.c b/source4/nbt_server/register.c
index b65bd6d5ac..3b7d57efaf 100644
--- a/source4/nbt_server/register.c
+++ b/source4/nbt_server/register.c
@@ -56,9 +56,10 @@ static void refresh_completion_handler(struct nbt_name_request *req)
iname->nb_flags &= ~NBT_NM_ACTIVE;
if (NT_STATUS_IS_OK(status)) {
- DEBUG(1,("Name conflict from %s refreshing name %s<%02x> on %s - rcode %d\n",
+ DEBUG(1,("Name conflict from %s refreshing name %s<%02x> on %s - %s\n",
io.out.reply_addr, iname->name.name, iname->name.type,
- iname->iface->ip_address, io.out.rcode));
+ iname->iface->ip_address,
+ nt_errstr(nbt_rcode_to_ntstatus(io.out.rcode))));
} else {
DEBUG(1,("Error refreshing name %s<%02x> on %s - %s\n",
iname->name.name, iname->name.type, iname->iface->ip_address,
@@ -92,6 +93,7 @@ static void name_refresh_handler(struct event_context *ev, struct timed_event *t
io.in.ttl = iname->ttl;
io.in.register_demand = False;
io.in.broadcast = True;
+ io.in.multi_homed = False;
io.in.timeout = 3;
io.in.retries = 0;
@@ -189,7 +191,7 @@ static void nbtd_register_name_iface(struct nbtd_interface *iface,
/* if this is the wins interface, then we need to do a special
wins name registration */
if (iface == iface->nbtsrv->wins_interface) {
- nbtd_winsclient_refresh(iname);
+ nbtd_winsclient_register(iname);
return;
}