summaryrefslogtreecommitdiff
path: root/usr.sbin/sasyncd/sasyncd.c
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2006-06-01 22:43:13 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2006-06-01 22:43:13 +0000
commit7cc0bcb3caa70f0c856cc5ff4119c1becd83708d (patch)
treeb5d4382246fb77c4ddd64d4634ca2b4b5d0ea462 /usr.sbin/sasyncd/sasyncd.c
parentfff1c1e24f6f58e55881a74c755dfe1e500b1ad0 (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/sasyncd.c')
-rw-r--r--usr.sbin/sasyncd/sasyncd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/sasyncd/sasyncd.c b/usr.sbin/sasyncd/sasyncd.c
index d5193fa4b5e..d9277382b93 100644
--- a/usr.sbin/sasyncd/sasyncd.c
+++ b/usr.sbin/sasyncd/sasyncd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sasyncd.c,v 1.9 2005/05/26 19:18:16 ho Exp $ */
+/* $OpenBSD: sasyncd.c,v 1.10 2006/06/01 22:43:12 mcbride Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -92,6 +92,10 @@ sasyncd_run(pid_t ppid)
if (cfgstate.pfkey_socket + 1 > maxfd)
maxfd = cfgstate.pfkey_socket + 1;
+ carp_set_rfd(rfds);
+ if (cfgstate.route_socket + 1 > maxfd)
+ maxfd = cfgstate.route_socket + 1;
+
timeout = &tv;
timer_next_event(&tv);
@@ -106,6 +110,7 @@ sasyncd_run(pid_t ppid)
net_send_messages(wfds);
pfkey_read_message(rfds);
pfkey_send_message(wfds);
+ carp_read_message(rfds);
}
timer_run();