]> git.proxmox.com Git - mirror_frr.git/commit - ldpd/lde.h
ldpd: simplify initialization of the child processes
authorRenato Westphal <renato@opensourcerouting.org>
Wed, 19 Apr 2017 01:03:35 +0000 (22:03 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 26 Apr 2017 13:36:30 +0000 (10:36 -0300)
commit274f5abf24fd5c9c79dce4102c3dfa583a791559
tree7c67de88798a29e37beea6424ca2b73c5aa8f124
parent01d1458f6abafaebeed04c1e6cb588298efb6546
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>
ldpd/control.c
ldpd/control.h
ldpd/lde.c
ldpd/lde.h
ldpd/ldpd.c
ldpd/ldpd.h
ldpd/ldpe.c
ldpd/ldpe.h