Can you try the diff below?

On Tue, 29 Nov 2011, Tom Knienieder wrote:

> Same problem and requirement here, I4m looking into this in the next days.
> 
> Regards,
> Tom
> 
> Am 23.11.2011 um 09:09 schrieb aniyokshuffle:
> 
> > Hi,
> >
> > In OpenBSD 5.0 the demote option of relayd.conf doesn't work anymore .
> >
> > Extract of relayd.conf :
> >
> > # Global Options
> > demote carp
> > timeout 3000
> > prefork 15
> > interval 5
> >
> > if i pkill relayd , carp interface stay in MASTER .
> >
> > In OpenBSD 4.8 it works well.


Index: parse.y
===================================================================
RCS file: /cvs/src/usr.sbin/relayd/parse.y,v
retrieving revision 1.159
diff -u -p -r1.159 parse.y
--- parse.y     21 Sep 2011 18:45:40 -0000      1.159
+++ parse.y     30 Dec 2011 19:22:13 -0000
@@ -2233,7 +2233,6 @@ load_config(const char *filename, struct
        struct host     *h, *ph;
 
        conf = x_conf;
-       conf->sc_flags = 0;
 
        loadcfg = 1;
        errors = 0;
Index: relayd.c
===================================================================
RCS file: /cvs/src/usr.sbin/relayd/relayd.c,v
retrieving revision 1.104
diff -u -p -r1.104 relayd.c
--- relayd.c    4 Sep 2011 20:26:58 -0000       1.104
+++ relayd.c    30 Dec 2011 19:22:13 -0000
@@ -259,6 +259,9 @@ main(int argc, char *argv[])
        if (parent_configure(env) == -1)
                fatalx("configuration failed");
 
+       if (env->sc_flags & F_DEMOTE)
+               carp_demote_reset(env->sc_demote_group, 0);
+
        init_routes(env);
 
        event_dispatch();

Reply via email to