summaryrefslogtreecommitdiffstats
path: root/source/nmbd/nmbd_elections.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-09-12 06:13:25 +0000
committerAndrew Tridgell <tridge@samba.org>2000-09-12 06:13:25 +0000
commitf1c49ca7ce56bc39259041a71479e84ebf53eeca (patch)
treedd0c0cf65ffd45f9589654669fdb519abaf82091 /source/nmbd/nmbd_elections.c
parent2ebfdd21b3123d7daefeeed4dae6e8bc3a7a7653 (diff)
downloadsamba-f1c49ca7ce56bc39259041a71479e84ebf53eeca.tar.gz
samba-f1c49ca7ce56bc39259041a71479e84ebf53eeca.tar.xz
samba-f1c49ca7ce56bc39259041a71479e84ebf53eeca.zip
- changed the msg_type to be an int instead of an enum so that it is
easier to add new message types to messages.h without breaking old binaries - added a MSG_FORCE_ELECTION message to force nmbd to hold an election
Diffstat (limited to 'source/nmbd/nmbd_elections.c')
-rw-r--r--source/nmbd/nmbd_elections.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/nmbd/nmbd_elections.c b/source/nmbd/nmbd_elections.c
index be38b572f66..522e268ae71 100644
--- a/source/nmbd/nmbd_elections.c
+++ b/source/nmbd/nmbd_elections.c
@@ -381,3 +381,24 @@ yet registered on subnet %s\n", nmb_namestr(&nmbname), subrec->subnet_name ));
}
return run_any_election;
}
+
+
+
+/****************************************************************************
+process a internal Samba message forcing an election
+***************************************************************************/
+void nmbd_message_election(int msg_type, pid_t src, void *buf, size_t len)
+{
+ struct subnet_record *subrec;
+
+ for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec)) {
+ struct work_record *work;
+ for (work = subrec->workgrouplist; work; work = work->next) {
+ if (strequal(work->work_group, global_myworkgroup)) {
+ work->needelection = True;
+ work->ElectionCount=0;
+ work->mst_state = lp_local_master() ? MST_POTENTIAL : MST_NONE;
+ }
+ }
+ }
+}