summaryrefslogtreecommitdiffstats
path: root/source3/nameresp.c
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1996-07-04 19:19:26 +0000
committerSamba Release Account <samba-bugs@samba.org>1996-07-04 19:19:26 +0000
commit7812ff08135318e74f5c286fe4773de8d1423969 (patch)
tree0ff953c4eb4bf2dfa3eb27d5f227a8a8c1384461 /source3/nameresp.c
parent9a08bb015caaf36095244d00b83184e0ebcfdfef (diff)
downloadsamba-7812ff08135318e74f5c286fe4773de8d1423969.tar.gz
samba-7812ff08135318e74f5c286fe4773de8d1423969.tar.xz
samba-7812ff08135318e74f5c286fe4773de8d1423969.zip
modified become_master() to a state-based system. becoming a master
is now performed in stages: wait for each NetBIOS name to be successfully registered before proceeding to the next stage. tied implicit name registration and release (broadcast method) to the same piece of code as explicit method (via WINS server). created special_browser_name() function that checks __MSBROWSE__ name: this name is ignored by WINS servers apparently. fixed likely incompatibility between refresh_my_names() and add_my_names(). (netbios entries were unlikely to be refreshed). NOTE: none of these changes have been tested. at all. lkcl (This used to be commit 7719fb06524a66ce5e3f30f3152ddb1e200c97f3)
Diffstat (limited to 'source3/nameresp.c')
-rw-r--r--source3/nameresp.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/source3/nameresp.c b/source3/nameresp.c
index c79c30d46f6..b153575116b 100644
--- a/source3/nameresp.c
+++ b/source3/nameresp.c
@@ -52,7 +52,7 @@ static void update_name_trn_id(void)
/***************************************************************************
- add an initated name query into the list
+ add an expected response record into the list
**************************************************************************/
static void add_response_record(struct subnet_record *d,
struct response_record *n)
@@ -78,6 +78,21 @@ static void add_response_record(struct subnet_record *d,
/***************************************************************************
+ remove an expected response record from the list
+ **************************************************************************/
+static void remove_response_record(struct subnet_record *d,
+ struct response_record *n)
+{
+ if (n->prev) n->prev->next = n->next;
+ if (n->next) n->next->prev = n->prev;
+
+ if (d->responselist == n) d->responselist = n->next;
+
+ free(n);
+}
+
+
+/***************************************************************************
deals with an entry before it dies
**************************************************************************/
static void dead_netbios_entry(struct subnet_record *d,
@@ -138,11 +153,12 @@ static void dead_netbios_entry(struct subnet_record *d,
if (ismyip(n->to_ip))
{
- remove_netbios_name(d,n->name.name,n->name.name_type,SELF,n->to_ip);
+ name_unregister_work(d,n->name.name,n->name.name_type);
}
if (!n->bcast)
{
- DEBUG(1,("WINS server did not respond to name release!\n"));
+ DEBUG(0,("WINS server did not respond to name release!\n"));
+ /* XXXX whoops. we have problems. must deal with this */
}
break;
}
@@ -161,10 +177,8 @@ static void dead_netbios_entry(struct subnet_record *d,
/* IMPORTANT: see response_name_reg() */
- enum name_source source = ismyip(n->to_ip) ? SELF : REGISTER;
-
- add_netbios_entry(d,n->name.name,n->name.name_type,
- n->nb_flags, n->ttl, source,n->to_ip, True,!n->bcast);
+ name_register_work(d,n->name.name,n->name.name_type,
+ n->nb_flags, n->ttl, n->to_ip, n->bcast);
}
else
{
@@ -175,6 +189,7 @@ static void dead_netbios_entry(struct subnet_record *d,
broadcasting. */
DEBUG(1,("WINS server did not respond to name registration!\n"));
+ /* XXXX whoops. we have problems. must deal with this */
}
break;
}
@@ -295,19 +310,12 @@ void expire_netbios_response_entries()
}
else
{
- dead_netbios_entry(d,n);
-
nextn = n->next;
-
- if (n->prev) n->prev->next = n->next;
- if (n->next) n->next->prev = n->prev;
-
- if (d->responselist == n) d->responselist = n->next;
-
- free(n);
-
num_response_packets--;
+ dead_netbios_entry (d,n); /* process the non-response */
+ remove_response_record(d,n); /* remove the non-response */
+
continue;
}
}