summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-01-28 17:29:47 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-01-28 17:29:47 +0000
commitc8cc948c380304d5a909f9213ee137aa7b8c2eab (patch)
tree4f3243a42915527543da2548efe5da998946b8b5 /usr.sbin
parent8078e4908ace26807aac186fced675a35e33f6c1 (diff)
call pfkey_auth_establish() on START events
call pfkey_auth_remove when a session drops back to IDLE state ok markus@ claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/session.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index d7c7cdae958..590075e9a62 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.95 2004/01/27 16:49:53 henning Exp $ */
+/* $OpenBSD: session.c,v 1.96 2004/01/28 17:29:46 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -381,6 +381,10 @@ bgp_fsm(struct peer *peer, enum session_events event)
/* init write buffer */
msgbuf_init(&peer->wbuf);
+ /* init pfkey */
+ if (pfkey_auth_establish(peer) == -1)
+ return;
+
if (peer->conf.passive) {
change_state(peer, STATE_ACTIVE, event);
peer->ConnectRetryTimer = 0;
@@ -646,6 +650,7 @@ change_state(struct peer *peer, enum session_state state,
msgbuf_clear(&peer->wbuf);
free(peer->rbuf);
peer->rbuf = NULL;
+ pfkey_auth_remove(peer);
if (peer->state == STATE_ESTABLISHED)
session_down(peer);
if (event != EVNT_STOP) {