]> git.ipfire.org Git - thirdparty/dhcpcd.git/commit
script: Write variables to a FILE
authorRoy Marples <roy@marples.name>
Tue, 18 Jun 2019 10:33:53 +0000 (11:33 +0100)
committerRoy Marples <roy@marples.name>
Tue, 18 Jun 2019 10:33:53 +0000 (11:33 +0100)
commitc8521994dab5002cbbd95df98d1b53a58421bdc7
treed692e469c71cd8f9e64a0fb62d701ae48bbbfc5e
parentcf94e2dd151245353b747ef7edb5e599a289ebd5
script: Write variables to a FILE

Each variable is NULL terminated inside the file just like the
control stream which saves us from having to flatten it when
writing to the control stream.
Once written, create env pointers to the start of each string
just after the NULL terminator.

This also means that we just need to free two buffers when
dhcpcd exits (FILE buffer and env buffer) rather than each variable
individually.

If open_memstream(3) is not supported by libc then dhcpcd will
write to a file in /tmp instead.
22 files changed:
configure
src/arp.c
src/auth.c
src/common.c
src/common.h
src/dhcp-common.c
src/dhcp-common.h
src/dhcp.c
src/dhcp.h
src/dhcp6.c
src/dhcp6.h
src/dhcpcd.c
src/dhcpcd.h
src/ipv4.c
src/ipv4ll.c
src/ipv4ll.h
src/ipv6.c
src/ipv6.h
src/ipv6nd.c
src/ipv6nd.h
src/script.c
src/script.h