summaryrefslogtreecommitdiff
path: root/source3/nameelect.c
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1997-05-21 18:18:38 +0000
committerSamba Release Account <samba-bugs@samba.org>1997-05-21 18:18:38 +0000
commitbd0d54cfd73cf9dae9be038ddf043252970127dc (patch)
tree0b1e9a713e5ef555abe5727ed2c7d58b74cea9d0 /source3/nameelect.c
parent79fcd3dc6af8ec6d9e9b42ca44f55c30637e920d (diff)
downloadsamba-bd0d54cfd73cf9dae9be038ddf043252970127dc.tar.gz
samba-bd0d54cfd73cf9dae9be038ddf043252970127dc.tar.bz2
samba-bd0d54cfd73cf9dae9be038ddf043252970127dc.zip
Added code to make nmbd always lose elections if 'local master'
parameter is set to False. jallison@whistle.com (This used to be commit 1bcf6791c79b846e3702bd2f91322b7666a8f323)
Diffstat (limited to 'source3/nameelect.c')
-rw-r--r--source3/nameelect.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/nameelect.c b/source3/nameelect.c
index 82cebd3e6c..35cbd754d1 100644
--- a/source3/nameelect.c
+++ b/source3/nameelect.c
@@ -699,6 +699,14 @@ static BOOL win_election(struct work_record *work,int version,uint32 criterion,
int mytimeup = time(NULL) - StartupTime;
uint32 mycriterion = work->ElectionCriterion;
+ /* If local master is set to false then never win
+ in election broadcasts. */
+ if(lp_local_master() == False)
+ {
+ DEBUG(3,("win_election: Losing election as local master == False\n"));
+ return False;
+ }
+
DEBUG(4,("election comparison: %x:%x %x:%x %d:%d %s:%s\n",
version,ELECTION_VERSION,
criterion,mycriterion,
@@ -748,7 +756,7 @@ void process_election(struct packet_struct *p,char *buf)
DEBUG(3,("Election request from %s %s vers=%d criterion=%08x timeup=%d\n",
name,inet_ntoa(p->ip),version,criterion,timeup));
-
+
if (same_context(dgram)) return;
for (work = d->workgrouplist; work; work = work->next)