summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/bgpd.c4
-rw-r--r--usr.sbin/bgpd/session.c32
-rw-r--r--usr.sbin/bgpd/session.h8
3 files changed, 26 insertions, 18 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c
index 9aeb5db5f35..8cb2b376101 100644
--- a/usr.sbin/bgpd/bgpd.c
+++ b/usr.sbin/bgpd/bgpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.c,v 1.82 2004/03/10 13:48:45 henning Exp $ */
+/* $OpenBSD: bgpd.c,v 1.83 2004/03/10 14:45:24 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -196,7 +196,7 @@ main(int argc, char *argv[])
/* fork children */
rde_pid = rde_main(&conf, peer_l, &net_l, rules_l, pipe_m2r, pipe_s2r);
- io_pid = session_main(&conf, peer_l, pipe_m2s, pipe_s2r);
+ io_pid = session_main(&conf, peer_l, rules_l, pipe_m2s, pipe_s2r);
setproctitle("parent");
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index 61477b44e11..d2f51c7fd5c 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.130 2004/03/10 14:29:37 henning Exp $ */
+/* $OpenBSD: session.c,v 1.131 2004/03/10 14:45:25 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -137,17 +137,18 @@ setup_listener(void)
int
-session_main(struct bgpd_config *config, struct peer *cpeers, int pipe_m2s[2],
- int pipe_s2r[2])
+session_main(struct bgpd_config *config, struct peer *cpeers,
+ struct filter_head *rules, int pipe_m2s[2], int pipe_s2r[2])
{
- int nfds, i, j, timeout, idx_peers;
- pid_t pid;
- time_t nextaction;
- struct passwd *pw;
- struct peer *p, *peer_l[OPEN_MAX], *last, *next;
- struct pollfd pfd[OPEN_MAX];
- struct ctl_conn *ctl_conn;
- short events;
+ int nfds, i, j, timeout, idx_peers;
+ pid_t pid;
+ time_t nextaction;
+ struct passwd *pw;
+ struct peer *p, *peer_l[OPEN_MAX], *last, *next;
+ struct filter_rule *r;
+ struct pollfd pfd[OPEN_MAX];
+ struct ctl_conn *ctl_conn;
+ short events;
conf = config;
peers = cpeers;
@@ -197,6 +198,13 @@ session_main(struct bgpd_config *config, struct peer *cpeers, int pipe_m2s[2],
csock = control_listen();
LIST_INIT(&mrt_l);
+ /* filter rules are not used in the SE */
+ while ((r = TAILQ_FIRST(rules)) != NULL) {
+ TAILQ_REMOVE(rules, r, entries);
+ free(r);
+ }
+ free(rules);
+
while (session_quit == 0) {
bzero(&pfd, sizeof(pfd));
pfd[PFD_LISTEN].fd = sock;
@@ -355,7 +363,7 @@ session_main(struct bgpd_config *config, struct peer *cpeers, int pipe_m2s[2],
control_shutdown();
log_info("session engine exiting");
- _exit(0);
+ exit(0);
}
void
diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h
index d40cfdec62b..9ab267941e4 100644
--- a/usr.sbin/bgpd/session.h
+++ b/usr.sbin/bgpd/session.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.h,v 1.35 2004/03/10 11:38:33 henning Exp $ */
+/* $OpenBSD: session.h,v 1.36 2004/03/10 14:45:25 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -169,9 +169,9 @@ struct peer {
struct peer *peers;
/* session.c */
-void session_socket_blockmode(int, enum blockmodes);
-int session_main(struct bgpd_config *, struct peer *, int[2],
- int[2]);
+void session_socket_blockmode(int, enum blockmodes);
+int session_main(struct bgpd_config *, struct peer *,
+ struct filter_head *, int[2], int[2]);
void bgp_fsm(struct peer *, enum session_events);
struct peer *getpeerbyip(in_addr_t);
int imsg_compose_parent(int, pid_t, void *, u_int16_t);