diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2004-08-05 21:01:39 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2004-08-05 21:01:39 +0000 |
commit | 63b8bc53049bffe0d707fba67efcc30e2f628935 (patch) | |
tree | 47ac409c47fa45b9fdedf1cc9185067fdb7b7f59 /usr.sbin/bgpd | |
parent | 193a1bd0aee27dc786bd14720d00d88ea77bfca5 (diff) |
The peer_l is not needed in the rde but still allocated, free them and
save 1k per peer. OK henning@
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/bgpd.c | 6 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde.c | 16 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.h | 4 |
3 files changed, 16 insertions, 10 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index e536f6058fb..d68e0fa8f3d 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.103 2004/08/03 13:43:29 claudio Exp $ */ +/* $OpenBSD: bgpd.c,v 1.104 2004/08/05 21:01:38 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -195,8 +195,8 @@ main(int argc, char *argv[]) prepare_listeners(&conf); /* fork children */ - rde_pid = rde_main(&conf, &net_l, rules_l, &mrt_l, pipe_m2r, pipe_s2r, - pipe_m2s); + rde_pid = rde_main(&conf, peer_l, &net_l, rules_l, &mrt_l, + pipe_m2r, pipe_s2r, pipe_m2s); io_pid = session_main(&conf, peer_l, &net_l, rules_l, &mrt_l, pipe_m2s, pipe_s2r, pipe_m2r); diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 1743fb0de0f..f8f54f18cca 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.136 2004/08/05 20:56:11 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.137 2004/08/05 21:01:38 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -103,12 +103,13 @@ u_int32_t pathhashsize = 1024; u_int32_t nexthophashsize = 64; pid_t -rde_main(struct bgpd_config *config, struct network_head *net_l, - struct filter_head *rules, struct mrt_head *mrt_l, - int pipe_m2r[2], int pipe_s2r[2], int pipe_m2s[2]) +rde_main(struct bgpd_config *config, struct peer *peer_l, + struct network_head *net_l, struct filter_head *rules, + struct mrt_head *mrt_l, int pipe_m2r[2], int pipe_s2r[2], int pipe_m2s[2]) { pid_t pid; struct passwd *pw; + struct peer *p; struct listen_addr *la; struct pollfd pfd[3]; int nfds, i; @@ -156,7 +157,12 @@ rde_main(struct bgpd_config *config, struct network_head *net_l, imsg_init(&ibuf_se, pipe_s2r[1]); imsg_init(&ibuf_main, pipe_m2r[1]); - /* main mrt list and listener list are not used in the SE */ + /* peer list, mrt list and listener list are not used in the RDE */ + while ((p = peer_l) != NULL) { + peer_l = p->next; + free(p); + } + while ((mrt = LIST_FIRST(mrt_l)) != NULL) { LIST_REMOVE(mrt, entry); free(mrt); diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h index 162d8738094..764c1f157f6 100644 --- a/usr.sbin/bgpd/session.h +++ b/usr.sbin/bgpd/session.h @@ -1,4 +1,4 @@ -/* $OpenBSD: session.h,v 1.59 2004/08/04 12:41:48 henning Exp $ */ +/* $OpenBSD: session.h,v 1.60 2004/08/05 21:01:38 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -213,7 +213,7 @@ int merge_config(struct bgpd_config *, struct bgpd_config *, void prepare_listeners(struct bgpd_config *); /* rde.c */ -pid_t rde_main(struct bgpd_config *, struct network_head *, +pid_t rde_main(struct bgpd_config *, struct peer *, struct network_head *, struct filter_head *, struct mrt_head *, int[2], int[2], int[2]); /* control.c */ |