summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-05-08 11:22:44 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-05-08 11:22:44 +0000
commit2d19220f67334235585a07f04f98bcd7a9f84401 (patch)
treebdce392692a539ceca5f5a87bdc3253541bc8018 /usr.sbin
parent4b2e01c5c104ffb058dd5624c8ab48acaa1aab71 (diff)
remove unused argument to control_dispatch_msg(), lint
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/control.c4
-rw-r--r--usr.sbin/bgpd/session.c9
-rw-r--r--usr.sbin/bgpd/session.h4
3 files changed, 9 insertions, 8 deletions
diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c
index 373b1e1902d..b64236286bd 100644
--- a/usr.sbin/bgpd/control.c
+++ b/usr.sbin/bgpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.29 2004/04/29 19:56:04 deraadt Exp $ */
+/* $OpenBSD: control.c,v 1.30 2004/05/08 11:22:43 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -174,7 +174,7 @@ control_close(int fd)
}
int
-control_dispatch_msg(struct pollfd *pfd, int i)
+control_dispatch_msg(struct pollfd *pfd)
{
struct imsg imsg;
struct ctl_conn *c;
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index 8438bab4516..12e41cbda68 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.168 2004/05/06 14:41:05 henning Exp $ */
+/* $OpenBSD: session.c,v 1.169 2004/05/08 11:22:43 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -386,12 +386,13 @@ session_main(struct bgpd_config *config, struct peer *cpeers,
nfds -= session_dispatch_msg(&pfd[j], peer_l[j]);
for (; nfds > 0 && j < i; j++)
- nfds -= control_dispatch_msg(&pfd[j], j);
+ nfds -= control_dispatch_msg(&pfd[j]);
}
while ((p = peers) != NULL) {
peers = p->next;
bgp_fsm(p, EVNT_STOP);
+ pfkey_remove(p);
free(p);
}
@@ -452,7 +453,8 @@ bgp_fsm(struct peer *peer, enum session_events event)
/* init write buffer */
msgbuf_init(&peer->wbuf);
- /* init pfkey */
+ /* init pfkey - remove old if any, load new ones */
+ pfkey_remove(peer);
if (pfkey_establish(peer) == -1) {
log_peer_warnx(&peer->conf,
"pfkey setup failed");
@@ -723,7 +725,6 @@ change_state(struct peer *peer, enum session_state state,
msgbuf_clear(&peer->wbuf);
free(peer->rbuf);
peer->rbuf = NULL;
- pfkey_remove(peer);
if (peer->state == STATE_ESTABLISHED)
session_down(peer);
if (event != EVNT_STOP && !peer->conf.cloned) {
diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h
index 0d8fc0a27f7..b57e0425581 100644
--- a/usr.sbin/bgpd/session.h
+++ b/usr.sbin/bgpd/session.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.h,v 1.50 2004/04/28 17:42:27 deraadt Exp $ */
+/* $OpenBSD: session.h,v 1.51 2004/05/08 11:22:43 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -210,7 +210,7 @@ int rde_main(struct bgpd_config *, struct network_head *,
/* control.c */
int control_listen(void);
void control_shutdown(void);
-int control_dispatch_msg(struct pollfd *, int);
+int control_dispatch_msg(struct pollfd *);
void control_accept(int);
void control_close(int);