summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2009-12-03 19:22:53 +0000
committerclaudio <claudio@openbsd.org>2009-12-03 19:22:53 +0000
commitad45d28fe3a74ebe56446545b8363e85d7b7666b (patch)
tree1481417c9a076168921f575c3ea4881d74715d4b
parentOnly log if there is a chance that the session may come up if the neighbor (diff)
downloadwireguard-openbsd-ad45d28fe3a74ebe56446545b8363e85d7b7666b.tar.xz
wireguard-openbsd-ad45d28fe3a74ebe56446545b8363e85d7b7666b.zip
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@
-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: