diff options
author | Samba Release Account <samba-bugs@samba.org> | 1996-07-09 18:01:46 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1996-07-09 18:01:46 +0000 |
commit | 9fdb312a69bc966aed8d917843559cb235e17a10 (patch) | |
tree | 7d4761669c5bc9600cd3ae7f39a1f216561580fd /source3/nameelect.c | |
parent | 3545a9b8734bfabdff760253dd73216aad25b925 (diff) | |
download | samba-9fdb312a69bc966aed8d917843559cb235e17a10.tar.gz samba-9fdb312a69bc966aed8d917843559cb235e17a10.tar.bz2 samba-9fdb312a69bc966aed8d917843559cb235e17a10.zip |
sorted out various timer delay bugs: nameannounce.c nameserv.c
namedbname.c:search_for_name() wasn't looking for 0x1b as well as
0x0 and 0x20 name types.
reduced number of retransmissions of packets from 4 to 3 times.
added code that ensures remote lmhosts entries don't get deleted when
a master browser cannot be found on a remote subnet. stopped forcing
an election on remote subnets if a master browser cannot be found.
stopped browse list and wins list from being written out too frequently.
only add samba's names to local interfaces.
add 0x1c name if we are a domain logon machine (needs more exploration).
why bother reloading services when receiving a SIGTERM?
sort out add_my_name_entry() and remove_name_entry() to deal with
broadcast, samba as a WINS and samba using a WINS. properly.
added extra debug information to help with expected response queue code.
updated debug comments in become_master().
altered dump_names() DEBUG format. it looks prettier.
altered wins.dat format to match DEBUG format.
lkcl
(This used to be commit 429f1f975e2936f2e220b656c51c211d48d47047)
Diffstat (limited to 'source3/nameelect.c')
-rw-r--r-- | source3/nameelect.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/source3/nameelect.c b/source3/nameelect.c index 386e7b0bab..e115b0d881 100644 --- a/source3/nameelect.c +++ b/source3/nameelect.c @@ -96,31 +96,32 @@ void browser_gone(char *work_name, struct in_addr ip) struct subnet_record *d = find_subnet(ip); struct work_record *work = find_workgroupstruct(d, work_name, False); + /* i don't know about this workgroup, therefore i don't care */ if (!work || !d) return; - - if (strequal(work->work_group, lp_workgroup()) && - ismybcast(d->bcast_ip)) - { + + if (strequal(work->work_group, lp_workgroup()) && d->my_interface) + { DEBUG(2,("Forcing election on %s %s\n", work->work_group,inet_ntoa(d->bcast_ip))); /* we can attempt to become master browser */ work->needelection = True; - } + } else - { - /* XXXX note: this will delete entries that have been added in by - lmhosts as well. a flag to ensure that these are not deleted may - be considered */ - - /* workgroup with no master browser is not the default workgroup: - it's also not on our subnet. therefore delete it: it can be - recreated dynamically */ - - send_election(d, work->work_group, 0, 0, myname); - remove_workgroup(d, work); - } + { + /* local interfaces: force an election */ + if (d->my_interface) + send_election(d, work->work_group, 0, 0, myname); + + /* only removes workgroup completely on a local interface or + if there are no server entries on the remote interface. + (persistent lmhost entries on a remote interface will stop + the workgroup being removed. persistent lmhosts entries on + a local interface _will_ be removed). + */ + remove_workgroup(d, work, d->my_interface); + } } @@ -247,7 +248,8 @@ void become_master(struct subnet_record *d, struct work_record *work) if (!work) return; - DEBUG(2,("Becoming master for %s (stage %d)",work->work_group,work->state)); + DEBUG(2,("Becoming master for %s (currently at stage %d)\n", + work->work_group,work->state)); switch (work->state) { @@ -261,7 +263,7 @@ void become_master(struct subnet_record *d, struct work_record *work) work->ServerType &= ~SV_TYPE_POTENTIAL_BROWSER; add_server_entry(d,work,myname,work->ServerType,0,ServerComment,True); - DEBUG(2,("first stage: register ^1^2__MSBROWSE__^2^1\n")); + DEBUG(3,("go to first stage: register ^1^2__MSBROWSE__^2^1\n")); /* add special browser name */ add_my_name_entry(d,MSBROWSE ,0x01,NB_ACTIVE|NB_GROUP); @@ -275,7 +277,7 @@ void become_master(struct subnet_record *d, struct work_record *work) /* add server entry on successful registration of MSBROWSE */ add_server_entry(d,work,work->work_group,domain_type,0,myname,True); - DEBUG(2,("second stage: register as master browser\n")); + DEBUG(3,("go to second stage: register as master browser\n")); /* add master name */ add_my_name_entry(d,work->work_group,0x1d,NB_ACTIVE ); @@ -298,13 +300,13 @@ void become_master(struct subnet_record *d, struct work_record *work) if (lp_domain_master()) { - DEBUG(2,("third stage: register as domain master\n")); + DEBUG(3,("third stage: register as domain master\n")); /* add domain master name */ add_my_name_entry(d,work->work_group,0x1b,NB_ACTIVE ); } else { - DEBUG(2,("samba not configured as a domain master: no third stage.\n")); + DEBUG(3,("samba not configured as a domain master: no third stage.\n")); } break; @@ -323,7 +325,7 @@ void become_master(struct subnet_record *d, struct work_record *work) work->ServerType |= SV_TYPE_DOMAIN_CTRL; work->ServerType |= SV_TYPE_DOMAIN_MEMBER; } - DEBUG(2,("fourth stage: samba is now a domain master.\n")); + DEBUG(3,("fourth stage: samba is now a domain master.\n")); add_server_entry(d,work,myname,work->ServerType,0,ServerComment,True); } @@ -332,7 +334,7 @@ void become_master(struct subnet_record *d, struct work_record *work) case MST_DOMAIN: { /* nothing else to become, at the moment: we are top-dog. */ - DEBUG(2,("fifth stage: there isn't one yet!\n")); + DEBUG(3,("fifth stage: there isn't one yet!\n")); break; } } |