summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/bgpd/carp.c7
-rw-r--r--usr.sbin/ospfd/carp.c7
2 files changed, 6 insertions, 8 deletions
diff --git a/usr.sbin/bgpd/carp.c b/usr.sbin/bgpd/carp.c
index 655a30df127..0659e83a9fd 100644
--- a/usr.sbin/bgpd/carp.c
+++ b/usr.sbin/bgpd/carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: carp.c,v 1.6 2008/09/10 15:00:01 tobias Exp $ */
+/* $OpenBSD: carp.c,v 1.7 2009/09/30 11:59:00 claudio Exp $ */
/*
* Copyright (c) 2006 Henning Brauer <henning@openbsd.org>
@@ -93,9 +93,8 @@ carp_demote_shutdown(void)
while ((c = TAILQ_FIRST(&carpgroups)) != NULL) {
TAILQ_REMOVE(&carpgroups, c, entry);
- for (; c->changed_by > 0; c->changed_by--)
- if (c->do_demote)
- carp_demote_ioctl(c->group, -1);
+ if (c->do_demote && c->changed_by > 0)
+ carp_demote_ioctl(c->group, -c->changed_by);
free(c->group);
free(c);
diff --git a/usr.sbin/ospfd/carp.c b/usr.sbin/ospfd/carp.c
index b633ba01708..d2d4c5041d7 100644
--- a/usr.sbin/ospfd/carp.c
+++ b/usr.sbin/ospfd/carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: carp.c,v 1.1 2007/05/29 22:08:25 claudio Exp $ */
+/* $OpenBSD: carp.c,v 1.2 2009/09/30 11:59:39 claudio Exp $ */
/*
* Copyright (c) 2006 Henning Brauer <henning@openbsd.org>
@@ -90,9 +90,8 @@ carp_demote_shutdown(void)
while ((c = TAILQ_FIRST(&carpgroups)) != NULL) {
TAILQ_REMOVE(&carpgroups, c, entry);
- for (; c->changed_by > 0; c->changed_by--)
- if (c->do_demote)
- carp_demote_ioctl(c->group, -1);
+ if (c->do_demote && c->changed_by > 0)
+ carp_demote_ioctl(c->group, -c->changed_by);
free(c->group);
free(c);