summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2021-03-17 09:19:35 +0100
committerLars Wendler <polynomial-c@gentoo.org>2021-03-17 09:21:25 +0100
commit8e359c57f050aa5e84fbaba79cf7615209de7292 (patch)
tree7762b2bfbf2ad774c768a91689740785798dfcdf /net-misc/dhcpcd/files
parentnet-misc/dhcpcd: Fixed build on sparc with USE="privsep" (diff)
downloadgentoo-8e359c57f050aa5e84fbaba79cf7615209de7292.tar.gz
gentoo-8e359c57f050aa5e84fbaba79cf7615209de7292.tar.bz2
gentoo-8e359c57f050aa5e84fbaba79cf7615209de7292.zip
net-misc/dhcpcd: Revbump to add some fixes from upstream
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Diffstat (limited to 'net-misc/dhcpcd/files')
-rw-r--r--net-misc/dhcpcd/files/dhcpcd-9.4.0-memleak_fix.patch36
-rw-r--r--net-misc/dhcpcd/files/dhcpcd-9.4.0-unlink_socket.patch55
2 files changed, 91 insertions, 0 deletions
diff --git a/net-misc/dhcpcd/files/dhcpcd-9.4.0-memleak_fix.patch b/net-misc/dhcpcd/files/dhcpcd-9.4.0-memleak_fix.patch
new file mode 100644
index 000000000000..61aed69656d3
--- /dev/null
+++ b/net-misc/dhcpcd/files/dhcpcd-9.4.0-memleak_fix.patch
@@ -0,0 +1,36 @@
+From ba9f3823ae825c341ea30f45b46d942b4ce5b8d9 Mon Sep 17 00:00:00 2001
+From: Roy Marples <roy@marples.name>
+Date: Sun, 24 Jan 2021 22:53:20 +0000
+Subject: [PATCH] Linux: fix a memory leak when dhcpcd exits or the log is
+ reopened
+
+---
+ src/logerr.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/logerr.c b/src/logerr.c
+index 21e933b8..35268870 100644
+--- a/src/logerr.c
++++ b/src/logerr.c
+@@ -484,13 +484,14 @@ logclose(void)
+ #endif
+
+ closelog();
++#if defined(__linux__)
++ free(_logprog);
++ _logprog = NULL;
++#endif
+ #ifndef SMALL
+ if (ctx->log_file == NULL)
+ return;
+ fclose(ctx->log_file);
+ ctx->log_file = NULL;
+ #endif
+-#if defined(__linux__)
+- free(_logprog);
+-#endif
+ }
+--
+2.30.0
+
+
diff --git a/net-misc/dhcpcd/files/dhcpcd-9.4.0-unlink_socket.patch b/net-misc/dhcpcd/files/dhcpcd-9.4.0-unlink_socket.patch
new file mode 100644
index 000000000000..493e9c342f51
--- /dev/null
+++ b/net-misc/dhcpcd/files/dhcpcd-9.4.0-unlink_socket.patch
@@ -0,0 +1,55 @@
+From d55f8e440389fbf333e14fe9f1a7d7f4da2b5197 Mon Sep 17 00:00:00 2001
+From: Roy Marples <roy@marples.name>
+Date: Tue, 26 Jan 2021 17:37:29 +0000
+Subject: [PATCH] control: unlink privileged socket when shutting down
+ without privsep
+
+Otherwise we have a connection refused when dhcpcd starts again
+as it sees the stale socket file.
+---
+ src/control.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/src/control.c b/src/control.c
+index 71405ed1..a601ad0a 100644
+--- a/src/control.c
++++ b/src/control.c
+@@ -50,7 +50,7 @@
+
+ #ifndef SUN_LEN
+ #define SUN_LEN(su) \
+- (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
++ (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
+ #endif
+
+ static void
+@@ -350,12 +350,12 @@ control_start1(struct dhcpcd_ctx *ctx, const char *ifname, sa_family_t family,
+ }
+ #endif
+
+- if ((fmode & S_PRIV) == S_PRIV)
+- strlcpy(ctx->control_sock, sa.sun_path,
+- sizeof(ctx->control_sock));
+- else
++ if ((fmode & S_UNPRIV) == S_UNPRIV)
+ strlcpy(ctx->control_sock_unpriv, sa.sun_path,
+ sizeof(ctx->control_sock_unpriv));
++ else
++ strlcpy(ctx->control_sock, sa.sun_path,
++ sizeof(ctx->control_sock));
+ return fd;
+ }
+
+@@ -368,7 +368,8 @@ control_start(struct dhcpcd_ctx *ctx, const char *ifname, sa_family_t family)
+ if (IN_PRIVSEP_SE(ctx)) {
+ make_path(ctx->control_sock, sizeof(ctx->control_sock),
+ ifname, family, false);
+- make_path(ctx->control_sock_unpriv, sizeof(ctx->control_sock),
++ make_path(ctx->control_sock_unpriv,
++ sizeof(ctx->control_sock_unpriv),
+ ifname, family, true);
+ return 0;
+ }
+--
+2.30.0
+