summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/control.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2006-05-23 12:11:39 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2006-05-23 12:11:39 +0000
commit3430a613b0777f27be2c5d1b53731fd0410160b8 (patch)
tree828164865de4d5a5c696fdebabbbac3165958c2f /usr.sbin/bgpd/control.c
parentbd0a71a1145af0072b689da3178830cdf67539d7 (diff)
allow bgpd to request a route refresh from a neighbor if that neighbor
announced route refresh capabilities
Diffstat (limited to 'usr.sbin/bgpd/control.c')
-rw-r--r--usr.sbin/bgpd/control.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c
index a22d3629cc4..27866a16c2c 100644
--- a/usr.sbin/bgpd/control.c
+++ b/usr.sbin/bgpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.49 2006/01/24 15:28:03 henning Exp $ */
+/* $OpenBSD: control.c,v 1.50 2006/05/23 12:11:38 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -279,6 +279,7 @@ control_dispatch_msg(struct pollfd *pfd, u_int *ctl_cnt)
case IMSG_CTL_NEIGHBOR_UP:
case IMSG_CTL_NEIGHBOR_DOWN:
case IMSG_CTL_NEIGHBOR_CLEAR:
+ case IMSG_CTL_NEIGHBOR_RREFRESH:
if (imsg.hdr.len == IMSG_HEADER_SIZE +
sizeof(struct ctl_neighbor)) {
neighbor = imsg.data;
@@ -293,19 +294,28 @@ control_dispatch_msg(struct pollfd *pfd, u_int *ctl_cnt)
switch (imsg.hdr.type) {
case IMSG_CTL_NEIGHBOR_UP:
bgp_fsm(p, EVNT_START);
+ control_result(c, CTL_RES_OK);
break;
case IMSG_CTL_NEIGHBOR_DOWN:
bgp_fsm(p, EVNT_STOP);
+ control_result(c, CTL_RES_OK);
break;
case IMSG_CTL_NEIGHBOR_CLEAR:
bgp_fsm(p, EVNT_STOP);
p->IdleHoldTimer = time(NULL) +
SESSION_CLEAR_DELAY;
+ control_result(c, CTL_RES_OK);
+ break;
+ case IMSG_CTL_NEIGHBOR_RREFRESH:
+ if (session_neighbor_rrefresh(p))
+ control_result(c,
+ CTL_RES_NOCAP);
+ else
+ control_result(c, CTL_RES_OK);
break;
default:
fatal("king bula wants more humppa");
}
- control_result(c, CTL_RES_OK);
} else
log_warnx("got IMSG_CTL_NEIGHBOR_ with "
"wrong length");