summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-09-30 12:08:53 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-09-30 12:08:53 +0000
commit071eee905e5c1bb03637cbd908ebc5d798b24360 (patch)
treebdf6c3469f3248134daabadb99b57aaa23866170
parent313eba493873a2bfe0fd3459f3afae4ffce01660 (diff)
carp_demote_ioctl() can handle more then +/-1 steps so there is no need to
loop in the shutdown case. OK henning@
-rw-r--r--usr.sbin/ripd/carp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/ripd/carp.c b/usr.sbin/ripd/carp.c
index fb832ea5ffe..d94c940eca3 100644
--- a/usr.sbin/ripd/carp.c
+++ b/usr.sbin/ripd/carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: carp.c,v 1.1 2008/12/17 14:19:39 michele Exp $ */
+/* $OpenBSD: carp.c,v 1.2 2009/09/30 12:08:52 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);