diff options
author | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2006-06-01 22:43:13 +0000 |
---|---|---|
committer | Ryan Thomas McBride <mcbride@cvs.openbsd.org> | 2006-06-01 22:43:13 +0000 |
commit | 7cc0bcb3caa70f0c856cc5ff4119c1becd83708d (patch) | |
tree | b5d4382246fb77c4ddd64d4634ca2b4b5d0ea462 /usr.sbin/sasyncd/conf.y | |
parent | fff1c1e24f6f58e55881a74c755dfe1e500b1ad0 (diff) |
Instead of polling the carp interface to detect a switch between MASTER and
BACKUP, listen to the routing socket for link change messages.
Based on a diff from nathanael at polymorpheous dot com.
ok moritz@
Diffstat (limited to 'usr.sbin/sasyncd/conf.y')
-rw-r--r-- | usr.sbin/sasyncd/conf.y | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/usr.sbin/sasyncd/conf.y b/usr.sbin/sasyncd/conf.y index 1156ff6b1b0..51108fd5293 100644 --- a/usr.sbin/sasyncd/conf.y +++ b/usr.sbin/sasyncd/conf.y @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.y,v 1.8 2006/03/31 17:38:18 pat Exp $ */ +/* $OpenBSD: conf.y,v 1.9 2006/06/01 22:43:12 mcbride Exp $ */ /* * Copyright (c) 2005 Håkan Olsson. All rights reserved. @@ -62,7 +62,7 @@ void yyerror(const char *); %token SKIPSLAVE %token <string> STRING %token <val> VALUE -%type <val> af port interval mode flushmode +%type <val> af port mode flushmode %% /* Rules */ @@ -97,23 +97,17 @@ modes : SKIPSLAVE } ; -interval : /* empty */ { $$ = CARP_DEFAULT_INTERVAL; } - | INTERVAL VALUE { $$ = $2; } - ; - flushmode : STARTUP { $$ = FM_STARTUP; } | NEVER { $$ = FM_NEVER; } | SYNC { $$ = FM_SYNC; } ; -setting : CARP INTERFACE STRING interval +setting : CARP INTERFACE STRING { if (cfgstate.carp_ifname) free(cfgstate.carp_ifname); cfgstate.carp_ifname = $3; - cfgstate.carp_check_interval = $4; - log_msg(2, "config: carp interface %s interval %d", - $3, $4); + log_msg(2, "config: carp interface %s", $3); } | FLUSHMODE flushmode { @@ -204,7 +198,6 @@ match(char *token) { "inet", INET }, { "inet6", INET6 }, { "interface", INTERFACE }, - { "interval", INTERVAL }, { "listen", LISTEN }, { "master", Y_MASTER }, { "mode", MODE }, @@ -346,7 +339,6 @@ conf_init(int argc, char **argv) cfgstate.runstate = INIT; LIST_INIT(&cfgstate.peerlist); - cfgstate.carp_check_interval = CARP_DEFAULT_INTERVAL; cfgstate.listen_port = SASYNCD_DEFAULT_PORT; while ((ch = getopt(argc, argv, "c:dv")) != -1) { |