summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-09-30 11:59:40 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-09-30 11:59:40 +0000
commite4003f04d127f6929ee07e6aad8e930acb071b42 (patch)
tree6098c9fc6097922713889ecb05593bcece70e86e /usr.sbin/bgpd
parent972b9cd3934a78937f80550d0ebfceea4d010956 (diff)
carp_demote_ioctl() can handle more then +/-1 steps so there is no need to
loop in the shutdown case. OK henning@
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/carp.c7
1 files changed, 3 insertions, 4 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);