summaryrefslogtreecommitdiffstats
path: root/ldpd/control.h
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-04-19 03:03:35 +0200
committerRenato Westphal <renato@opensourcerouting.org>2017-04-26 15:36:30 +0200
commit274f5abf24fd5c9c79dce4102c3dfa583a791559 (patch)
tree7c67de88798a29e37beea6424ca2b73c5aa8f124 /ldpd/control.h
parentldpd: remove two unused imsg types (diff)
downloadfrr-274f5abf24fd5c9c79dce4102c3dfa583a791559.tar.xz
frr-274f5abf24fd5c9c79dce4102c3dfa583a791559.zip
ldpd: simplify initialization of the child processes
In order to have separate ASLR/cookies per process, ldpd calls exec() in the child processes after fork() (this is also known as the fork+exec model). This is an important security feature but it makes the initialization of the child processes a bit more complicated as they're not a copy of the parent anymore, so all parameters given via command line are lost. To solve this problem, we were creating an argv array by hand with all necessary parameters and providing it to the exec() syscall. This works but it's a very ugly solution. This patch introduces a different approach to solve the problem: send an IMSG_INIT message to the child processes with all parameters they need in order to initialize properly. This makes adding additional initialization parameters much more convenient and less error prone. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ldpd/control.h')
-rw-r--r--ldpd/control.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/ldpd/control.h b/ldpd/control.h
index 32c49fdf8..0e66a1636 100644
--- a/ldpd/control.h
+++ b/ldpd/control.h
@@ -29,9 +29,9 @@ TAILQ_HEAD(ctl_conns, ctl_conn);
extern struct ctl_conns ctl_conns;
-int control_init(void);
+int control_init(char *);
int control_listen(void);
-void control_cleanup(void);
+void control_cleanup(char *);
int control_imsg_relay(struct imsg *);
#endif /* _CONTROL_H_ */