diff options
author | Andrew Tridgell <tridge@samba.org> | 1996-06-05 15:44:24 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1996-06-05 15:44:24 +0000 |
commit | f6655e8a385181bdbff0e7ac7f6a8dcbce60360b (patch) | |
tree | 244e334b5d8e5a17f90e08d7f648864db9eece14 /source3/nameelect.c | |
parent | e38afbf38210b8cf30c5b13dc5ea96a6dda433f7 (diff) | |
download | samba-f6655e8a385181bdbff0e7ac7f6a8dcbce60360b.tar.gz samba-f6655e8a385181bdbff0e7ac7f6a8dcbce60360b.tar.bz2 samba-f6655e8a385181bdbff0e7ac7f6a8dcbce60360b.zip |
- remove some incorrect prototypes from server.c
- formatting cleanup in check_master_browser()
- removed unused code from nameserv.c
(This used to be commit ed3ef2e47d5039077993c6addaf44dce2bb1e780)
Diffstat (limited to 'source3/nameelect.c')
-rw-r--r-- | source3/nameelect.c | 88 |
1 files changed, 45 insertions, 43 deletions
diff --git a/source3/nameelect.c b/source3/nameelect.c index 34455b27f9..8ceae473a7 100644 --- a/source3/nameelect.c +++ b/source3/nameelect.c @@ -54,31 +54,33 @@ extern struct domain_record *domainlist; ******************************************************************/ void check_master_browser(void) { - static time_t lastrun=0; - time_t t = time(NULL); - struct domain_record *d; + static time_t lastrun=0; + time_t t = time(NULL); + struct domain_record *d; - if (!lastrun) lastrun = t; - if (t < lastrun + 2*60) return; - lastrun = t; + if (!lastrun) lastrun = t; + if (t < lastrun + 2*60) return; + lastrun = t; - for (d = domainlist; d; d = d->next) - { - struct work_record *work; + dump_workgroups(); - for (work = d->workgrouplist; work; work = work->next) - { - /* if we are not the browse master of a workgroup, and we can't - find a browser on the subnet, do something about it. */ + for (d = domainlist; d; d = d->next) + { + struct work_record *work; - if (!AM_MASTER(work)) - { - queue_netbios_packet(ClientNMB,NMB_QUERY,CHECK_MASTER, - work->work_group,0x1d,0, - True,False,d->bcast_ip); - } - } + for (work = d->workgrouplist; work; work = work->next) + { + /* if we are not the browse master of a workgroup, and we can't + find a browser on the subnet, do something about it. */ + + if (!AM_MASTER(work)) + { + queue_netbios_packet(ClientNMB,NMB_QUERY,CHECK_MASTER, + work->work_group,0x1d,0, + True,False,d->bcast_ip); + } } + } } @@ -87,32 +89,32 @@ void check_master_browser(void) ******************************************************************/ void browser_gone(char *work_name, struct in_addr ip) { - struct domain_record *d = find_domain(ip); - struct work_record *work = find_workgroupstruct(d, work_name, False); + struct domain_record *d = find_domain(ip); + struct work_record *work = find_workgroupstruct(d, work_name, False); - if (!work || !d) return; + if (!work || !d) return; - DEBUG(2,("Forcing election on %s\n",work->work_group)); + DEBUG(2,("Forcing election on %s\n",work->work_group)); - if (strequal(work->work_group, lp_workgroup()) && - ip_equal(bcast_ip, d->bcast_ip)) - { - /* we can attempt to become master browser */ - work->needelection = True; - } - else - { - DEBUG(2,("no master browser for persistent entry %s %s\n", - work->work_group, inet_ntoa(d->bcast_ip))); - - /* XXXX oh dear. we are going to have problems here. the - entry is a persistent one, there isn't anyone responsible - for this workgroup up and running, yet we can't find it - and we are going to continually have name_queries until - a master browser is found for this workgroup on the - remote subnet. - */ - } + if (strequal(work->work_group, lp_workgroup()) && + ip_equal(bcast_ip, d->bcast_ip)) + { + /* we can attempt to become master browser */ + work->needelection = True; + } + else + { + DEBUG(2,("no master browser for persistent entry %s %s\n", + work->work_group, inet_ntoa(d->bcast_ip))); + + /* XXXX oh dear. we are going to have problems here. the + entry is a persistent one, there isn't anyone responsible + for this workgroup up and running, yet we can't find it + and we are going to continually have name_queries until + a master browser is found for this workgroup on the + remote subnet. + */ + } } /**************************************************************************** send an election packet |