Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/dhcpcd/dist Update to dhcpcd-9.0.1 with the fol...
details: https://anonhg.NetBSD.org/src/rev/7fc4465fe45e
branches: trunk
changeset: 971098:7fc4465fe45e
user: roy <roy%NetBSD.org@localhost>
date: Mon Apr 13 15:42:20 2020 +0000
description:
Update to dhcpcd-9.0.1 with the following changes:
* privsep: Improve error when we don't have permission to write lease
PR bin/55135
* privsep: Fix hooks restarting other daemons
diffstat:
external/bsd/dhcpcd/dist/README.md | 4 +---
external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in | 4 +---
external/bsd/dhcpcd/dist/src/defs.h | 2 +-
external/bsd/dhcpcd/dist/src/ipv6nd.h | 1 +
external/bsd/dhcpcd/dist/src/privsep-root.c | 4 +++-
external/bsd/dhcpcd/dist/src/privsep.c | 5 ++++-
external/bsd/dhcpcd/dist/src/route.h | 15 +++++++++++++++
external/bsd/dhcpcd/dist/src/script.h | 2 +-
8 files changed, 27 insertions(+), 10 deletions(-)
diffs (147 lines):
diff -r fd2a85229e40 -r 7fc4465fe45e external/bsd/dhcpcd/dist/README.md
--- a/external/bsd/dhcpcd/dist/README.md Mon Apr 13 15:26:57 2020 +0000
+++ b/external/bsd/dhcpcd/dist/README.md Mon Apr 13 15:42:20 2020 +0000
@@ -90,9 +90,7 @@
`/var/db` and now stores dhcpcd.duid and dhcpcd.secret in there instead of
in /etc.
dhcpcd-9 requires this directory and contents to be writeable by the
-unprivileged user (default _dhcpcd).
-The Makefile `_confinstall` target will attempt to move the files correctly from
-the old locations to the new locations.
+unprivileged user (default _dhcpcd, _dhcp or dhcpcd).
Of course this won't work if dhcpcd is packaged up, so packagers will need to
install similar logic into their dhcpcd package.
diff -r fd2a85229e40 -r 7fc4465fe45e external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
--- a/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in Mon Apr 13 15:26:57 2020 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in Mon Apr 13 15:42:20 2020 +0000
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd January 21, 2020
+.Dd April 3, 2020
.Dt DHCPCD-RUN-HOOKS 8
.Os
.Sh NAME
@@ -136,8 +136,6 @@
This normally happens when dhcpcd does not support the raw interface, which
means it cannot work as a DHCP or ZeroConf client.
Static configuration and DHCP INFORM is still allowed.
-.It Dv DUMP
-dhcpcd has been asked to dump the last lease for the interface.
.It Dv TEST
dhcpcd received an OFFER from a DHCP server but will not configure the
interface.
diff -r fd2a85229e40 -r 7fc4465fe45e external/bsd/dhcpcd/dist/src/defs.h
--- a/external/bsd/dhcpcd/dist/src/defs.h Mon Apr 13 15:26:57 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/defs.h Mon Apr 13 15:42:20 2020 +0000
@@ -29,7 +29,7 @@
#define CONFIG_H
#define PACKAGE "dhcpcd"
-#define VERSION "9.0.0"
+#define VERSION "9.0.1"
#ifndef PRIVSEP_USER
# define PRIVSEP_USER "_" PACKAGE
diff -r fd2a85229e40 -r 7fc4465fe45e external/bsd/dhcpcd/dist/src/ipv6nd.h
--- a/external/bsd/dhcpcd/dist/src/ipv6nd.h Mon Apr 13 15:26:57 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/ipv6nd.h Mon Apr 13 15:42:20 2020 +0000
@@ -104,6 +104,7 @@
int ipv6nd_open(struct dhcpcd_ctx *);
#endif
void ipv6nd_recvmsg(struct dhcpcd_ctx *, struct msghdr *);
+int ipv6nd_rtpref(struct ra *);
void ipv6nd_printoptions(const struct dhcpcd_ctx *,
const struct dhcp_opt *, size_t);
void ipv6nd_startrs(struct interface *);
diff -r fd2a85229e40 -r 7fc4465fe45e external/bsd/dhcpcd/dist/src/privsep-root.c
--- a/external/bsd/dhcpcd/dist/src/privsep-root.c Mon Apr 13 15:26:57 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/privsep-root.c Mon Apr 13 15:42:20 2020 +0000
@@ -188,7 +188,7 @@
if (script_buftoenv(ctx, UNCONST(envbuf), len) == NULL)
return -1;
- pid = script_exec(ctx, argv, ctx->script_env);
+ pid = script_exec(argv, ctx->script_env);
if (pid == -1)
return -1;
/* Wait for the script to finish */
@@ -435,8 +435,10 @@
struct dhcpcd_ctx *ctx = arg;
ssize_t err;
+#ifdef INET
err = ps_bpf_dispatch(ctx, psm, msg);
if (err == -1 && errno == ENOTSUP)
+#endif
err = ps_inet_dispatch(ctx, psm, msg);
return err;
}
diff -r fd2a85229e40 -r 7fc4465fe45e external/bsd/dhcpcd/dist/src/privsep.c
--- a/external/bsd/dhcpcd/dist/src/privsep.c Mon Apr 13 15:26:57 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/privsep.c Mon Apr 13 15:42:20 2020 +0000
@@ -115,6 +115,7 @@
/* If we pickup the _dhcp user refuse the default directory */
if (strcmp(pw->pw_dir, "/var/empty") == 0) {
+ ctx->options &= ~DHCPCD_PRIVSEP;
logerrx("refusing chroot: %s: %s", PRIVSEP_USER, pw->pw_dir);
errno = 0;
return -1;
@@ -226,7 +227,9 @@
logerr("%s: eloop_signal_set_cb", __func__);
goto errexit;
}
- if (eloop_signal_mask(ctx->eloop, &ctx->sigset) == -1) {
+
+ /* ctx->sigset aready has the initial sigmask set in main() */
+ if (eloop_signal_mask(ctx->eloop, NULL) == -1) {
logerr("%s: eloop_signal_mask", __func__);
goto errexit;
}
diff -r fd2a85229e40 -r 7fc4465fe45e external/bsd/dhcpcd/dist/src/route.h
--- a/external/bsd/dhcpcd/dist/src/route.h Mon Apr 13 15:26:57 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/route.h Mon Apr 13 15:42:20 2020 +0000
@@ -60,6 +60,13 @@
# endif
#endif
+#ifdef __linux__
+# include <linux/version.h> /* RTA_PREF is only an enum.... */
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)
+# define HAVE_ROUTE_PREF
+# endif
+#endif
+
#if defined(__OpenBSD__) || defined (__sun)
# define ROUTE_PER_GATEWAY
/* XXX dhcpcd doesn't really support this yet.
@@ -86,6 +93,14 @@
#ifdef HAVE_ROUTE_METRIC
unsigned int rt_metric;
#endif
+#ifdef HAVE_ROUTE_PREF
+ int rt_pref;
+#endif
+#define RTPREF_HIGH 1
+#define RTPREF_MEDIUM 0 /* has to be zero */
+#define RTPREF_LOW (-1)
+#define RTPREF_RESERVED (-2)
+#define RTPREF_INVALID (-3) /* internal */
unsigned int rt_dflags;
#define RTDF_IFA_ROUTE 0x02 /* Address generated route */
#define RTDF_FAKE 0x04 /* Maybe us on lease reboot */
diff -r fd2a85229e40 -r 7fc4465fe45e external/bsd/dhcpcd/dist/src/script.h
--- a/external/bsd/dhcpcd/dist/src/script.h Mon Apr 13 15:26:57 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/script.h Mon Apr 13 15:42:20 2020 +0000
@@ -34,7 +34,7 @@
__printflike(2, 3) int efprintf(FILE *, const char *, ...);
void if_printoptions(void);
char ** script_buftoenv(struct dhcpcd_ctx *, char *, size_t);
-pid_t script_exec(const struct dhcpcd_ctx *, char *const *, char *const *);
+pid_t script_exec(char *const *, char *const *);
int send_interface(struct fd_list *, const struct interface *, int);
int script_runreason(const struct interface *, const char *);
int script_runchroot(struct dhcpcd_ctx *, char *);
Home |
Main Index |
Thread Index |
Old Index