nixpkgs/pkgs/tools/networking/dhcpcd/reload.patch
Eelco Dolstra 993e8da496 dhcpcd: Update to 6.4.0
The lxc_ro_promote_secondaries patch no longer applies so I disabled
it for now (@offlinehacker).
2014-07-03 12:18:44 +02:00

26 lines
597 B
Diff

Fix segfault when reloading the configuration: free_globals() left the
ifac/ifdc variables at -1 instead of 0, causing a crash later in
splitv().
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -143,16 +143,18 @@
if (ctx->ifac) {
for (ctx->ifac--; ctx->ifac >= 0; ctx->ifac--)
free(ctx->ifav[ctx->ifac]);
free(ctx->ifav);
ctx->ifav = NULL;
+ ctx->ifac = 0;
}
if (ctx->ifdc) {
for (ctx->ifdc--; ctx->ifdc >= 0; ctx->ifdc--)
free(ctx->ifdv[ctx->ifdc]);
free(ctx->ifdv);
ctx->ifdv = NULL;
+ ctx->ifdc = 0;
}
#ifdef INET
if (ctx->dhcp_opts) {
for (opt = ctx->dhcp_opts;