]> git.ipfire.org Git - thirdparty/systemd.git/commit
network-ndisc: avoid VLAs (#3725)
authorDaniel Mack <github@zonque.org>
Fri, 15 Jul 2016 02:56:11 +0000 (04:56 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 15 Jul 2016 02:56:11 +0000 (22:56 -0400)
commita34349e73348d16d0f41910a38f515f78d18d396
tree9816086dbef8e3f0ab58cf3d0fbafaba191bbd3f
parentf749954d924dc126fd3b8a5539b537ddb1a07f71
network-ndisc: avoid VLAs (#3725)

Do not allocate objects of dynamic and potentially large size on the stack
to avoid both clang compilation errors and unpredictable runtime behavior
on exotic platforms. Use the heap for that instead.

While at it, refactor the code a bit. Access 's->domain' via
NDISC_DNSSL_DOMAIN(), and refrain from allocating 'x' independently, but
rather reuse 's' if we're dealing with a new entry to the set.

Fixes #3717
src/network/networkd-ndisc.c