summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-12-03 19:22:54 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-12-03 19:22:54 +0000
commit787345d08c8df51657d9c615d583f4e5786d904f (patch)
treef8e0d06d75f09d6f073098c0c0f2583ba9d65294 /usr.sbin
parent34cc73ade3eedfef48dcf21820326c88b840c17c (diff)
A bgpctl nei XY clear should not restart neighbors that are administrativly
down. So after a bgpctl reload clearing a neighbor will bring that neighbor into the configured state (in this case down). OK henning@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/control.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c
index 3ae589677bb..f6760cb7698 100644
--- a/usr.sbin/bgpd/control.c
+++ b/usr.sbin/bgpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.65 2009/12/02 19:10:02 mk Exp $ */
+/* $OpenBSD: control.c,v 1.66 2009/12/03 19:22:53 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -333,9 +333,15 @@ control_dispatch_msg(struct pollfd *pfd, u_int *ctl_cnt)
control_result(c, CTL_RES_OK);
break;
case IMSG_CTL_NEIGHBOR_CLEAR:
- session_stop(p, ERR_CEASE_ADMIN_RESET);
- timer_set(p, Timer_IdleHold,
- SESSION_CLEAR_DELAY);
+ if (!p->conf.down) {
+ session_stop(p,
+ ERR_CEASE_ADMIN_RESET);
+ timer_set(p, Timer_IdleHold,
+ SESSION_CLEAR_DELAY);
+ } else {
+ session_stop(p,
+ ERR_CEASE_ADMIN_DOWN);
+ }
control_result(c, CTL_RES_OK);
break;
case IMSG_CTL_NEIGHBOR_RREFRESH: