summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-07-01 07:19:12 +0000
committerAndrew Tridgell <tridge@samba.org>2002-07-01 07:19:12 +0000
commitd4c3fd3d0df040e8c43c517033def9f635a2769c (patch)
treec44f05b2682b6942f847685fc14a2036019de1cc
parentcf634de37b0a2203341bd5be7156e2cc86b0be03 (diff)
downloadsamba-d4c3fd3d0df040e8c43c517033def9f635a2769c.tar.gz
samba-d4c3fd3d0df040e8c43c517033def9f635a2769c.tar.bz2
samba-d4c3fd3d0df040e8c43c517033def9f635a2769c.zip
fixed multi-homed re-registration of names when we are a WINS
server. We were rejecting them, leaving the name unregistered! (This used to be commit 2dc539ed33f9893cbe9e16c386994933121b71e9)
-rw-r--r--source3/nmbd/nmbd_winsserver.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c
index 3332e99e9d..13554a9430 100644
--- a/source3/nmbd/nmbd_winsserver.c
+++ b/source3/nmbd/nmbd_winsserver.c
@@ -983,7 +983,7 @@ static void wins_multihomed_register_query_success(struct subnet_record *subrec,
if( (namerec == NULL) || (namerec->data.source != REGISTER_NAME) || !WINS_STATE_ACTIVE(namerec) )
{
DEBUG(3,("wins_multihomed_register_query_success: name %s is not in the correct state to add \
-a subsequent IP addess.\n", nmb_namestr(question_name) ));
+a subsequent IP address.\n", nmb_namestr(question_name) ));
send_wins_name_registration_response(RFS_ERR, 0, orig_reg_packet);
orig_reg_packet->locked = False;
@@ -1101,6 +1101,16 @@ to register name %s from IP %s.", nmb_namestr(question), inet_ntoa(p->ip) ));
namerec = find_name_on_subnet(subrec, question, FIND_ANY_NAME);
/*
+ * if the record exists but NOT in active state,
+ * consider it dead.
+ */
+ if ((namerec != NULL) && !WINS_STATE_ACTIVE(namerec)) {
+ DEBUG(5,("wins_process_multihomed_name_registration_request: Name (%s) in WINS was not active - removing it.\n", nmb_namestr(question)));
+ remove_name_from_namelist(subrec, namerec);
+ namerec = NULL;
+ }
+
+ /*
* Deal with the case where the name found was a dns entry.
* Remove it as we now have a NetBIOS client registering the
* name.