diff options
author | Samba Release Account <samba-bugs@samba.org> | 1996-07-04 19:19:26 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1996-07-04 19:19:26 +0000 |
commit | 7719fb06524a66ce5e3f30f3152ddb1e200c97f3 (patch) | |
tree | 911610f1e4615b5c42b22668abc347fee3e0ce4c /source/nameresp.c | |
parent | a7be82ee6e56481b907ab3672b214639ec63c9b5 (diff) | |
download | samba-7719fb06524a66ce5e3f30f3152ddb1e200c97f3.tar.gz samba-7719fb06524a66ce5e3f30f3152ddb1e200c97f3.tar.xz samba-7719fb06524a66ce5e3f30f3152ddb1e200c97f3.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
Diffstat (limited to 'source/nameresp.c')
-rw-r--r-- | source/nameresp.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/source/nameresp.c b/source/nameresp.c index c79c30d46f6..b153575116b 100644 --- a/source/nameresp.c +++ b/source/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; } } |