diff options
author | claudio <claudio@openbsd.org> | 2007-01-08 13:01:10 +0000 |
---|---|---|
committer | claudio <claudio@openbsd.org> | 2007-01-08 13:01:10 +0000 |
commit | 9bb9ec63e0455ff24494359d6bff3dd792d34d5a (patch) | |
tree | 8f2e56999678aba098f25e33733c82dac63adbf9 /usr.sbin/ripd/ripe.c | |
parent | fix mem leak, from NetBSD; ok miod@ kettenis@ (diff) | |
download | wireguard-openbsd-9bb9ec63e0455ff24494359d6bff3dd792d34d5a.tar.xz wireguard-openbsd-9bb9ec63e0455ff24494359d6bff3dd792d34d5a.zip |
New redistribute code adapted from ospfd. It is now possible to do the same
redistribute setups as in ospfd (rtlables, per prefix, negation).
Tested, input and OK michele@
Diffstat (limited to 'usr.sbin/ripd/ripe.c')
-rw-r--r-- | usr.sbin/ripd/ripe.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.sbin/ripd/ripe.c b/usr.sbin/ripd/ripe.c index 4abbb4040c2..559a32fd557 100644 --- a/usr.sbin/ripd/ripe.c +++ b/usr.sbin/ripd/ripe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ripe.c,v 1.4 2006/11/28 19:21:16 reyk Exp $ */ +/* $OpenBSD: ripe.c,v 1.5 2007/01/08 13:01:10 claudio Exp $ */ /* * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> @@ -69,10 +69,11 @@ pid_t ripe(struct ripd_conf *xconf, int pipe_parent2ripe[2], int pipe_ripe2rde[2], int pipe_parent2rde[2]) { - struct iface *iface = NULL; + struct event ev_sigint, ev_sigterm; struct sockaddr_in addr; + struct iface *iface = NULL; struct passwd *pw; - struct event ev_sigint, ev_sigterm; + struct redistribute *r; pid_t pid; switch (pid = fork()) { @@ -170,6 +171,12 @@ ripe(struct ripd_conf *xconf, int pipe_parent2ripe[2], int pipe_ripe2rde[2], recv_packet, oeconf); event_add(&oeconf->ev, NULL); + /* remove unneeded config stuff */ + while ((r = SIMPLEQ_FIRST(&oeconf->redist_list)) != NULL) { + SIMPLEQ_REMOVE_HEAD(&oeconf->redist_list, entry); + free(r); + } + /* listen on ripd control socket */ TAILQ_INIT(&ctl_conns); control_listen(); |