nixpkgs/pkgs/tools/networking/dhcpcd/reload.patch
Eelco Dolstra 2d8c0d24f2 dhcpcd: Fix segfaults
This fixes several problems in the dhcpcd service:

* A segfault during startup, due to a race with udev (dhcpcd would get
  an ADD event from udev, causing it to re-add an interface that it
  already had, leading to a segfault later on).

* A hang/segfault processing "dhcpcd rebind" (which NixOS calls after
  waking up from suspend).

Also, add "lo" to the list of ignored interfaces. It usually ignores
"lo", but apparently not when it gets an ADD event from udev.
2014-04-24 15:19:26 +02:00

22 lines
450 B
Diff

--- 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;