summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bgpd/session.c')
-rw-r--r--usr.sbin/bgpd/session.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index 108865abe28..c6fdc57e90c 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.232 2005/07/24 11:56:37 henning Exp $ */
+/* $OpenBSD: session.c,v 1.233 2005/09/08 10:46:40 henning Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -531,10 +531,6 @@ init_peer(struct peer *p)
{
p->fd = p->wbuf.fd = -1;
- memcpy(&p->capa.ann, &p->conf.capabilities, sizeof(p->capa.ann));
- if (!p->conf.announce_capa)
- session_capa_ann_none(p);
-
if (p->conf.if_depend[0])
imsg_compose(ibuf_main, IMSG_IFINFO, 0, 0, -1,
p->conf.if_depend, sizeof(p->conf.if_depend));
@@ -857,6 +853,13 @@ change_state(struct peer *peer, enum session_state state,
peer->IdleHoldTime < MAX_IDLE_HOLD/2)
peer->IdleHoldTime *= 2;
}
+ if (event != EVNT_RCVD_OPEN) { /* capa negotiation */
+ /* initialize capability negotiation structures */
+ memcpy(&peer->capa.ann, &peer->conf.capabilities,
+ sizeof(peer->capa.ann));
+ if (!peer->conf.announce_capa)
+ session_capa_ann_none(peer);
+ }
break;
case STATE_CONNECT:
break;