summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd_elections.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-06-27 01:07:30 +0000
committerJeremy Allison <jra@samba.org>1998-06-27 01:07:30 +0000
commitfdb124c1cd0e91fa2a5f1c993a1df12fb866cca9 (patch)
tree1c4c8345c6a7fd0ee9eaa25dc9c765e5b268f10c /source3/nmbd/nmbd_elections.c
parentd8b0a8bab2334e9214975e3ac35c1556c4030fd9 (diff)
downloadsamba-fdb124c1cd0e91fa2a5f1c993a1df12fb866cca9.tar.gz
samba-fdb124c1cd0e91fa2a5f1c993a1df12fb866cca9.tar.bz2
samba-fdb124c1cd0e91fa2a5f1c993a1df12fb866cca9.zip
Added code to do elections when told to do so.
Jeremy. (This used to be commit a38d903d2016202d470f1405e593be3c20404d72)
Diffstat (limited to 'source3/nmbd/nmbd_elections.c')
-rw-r--r--source3/nmbd/nmbd_elections.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/nmbd/nmbd_elections.c b/source3/nmbd/nmbd_elections.c
index 4be5b73508..ceef961d5e 100644
--- a/source3/nmbd/nmbd_elections.c
+++ b/source3/nmbd/nmbd_elections.c
@@ -348,8 +348,15 @@ BOOL check_elections(void)
{
run_any_election |= work->RunningElection;
- /* Only start an election if we are in the potential browser state. */
- if (work->needelection && !work->RunningElection && AM_POTENTIAL_MASTER_BROWSER(work))
+ /*
+ * Start an election if we have any chance of winning.
+ * Note this is a change to the previous code, that would
+ * only run an election if nmbd was in the potential browser
+ * state. We need to run elections in any state if we're told
+ * to. JRA.
+ */
+
+ if (work->needelection && !work->RunningElection && lp_local_master())
{
/*
* We can only run an election for a workgroup if we have