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.4.1 with the fol...
details: https://anonhg.NetBSD.org/src/rev/934878691e6d
branches: trunk
changeset: 989972:934878691e6d
user: roy <roy%NetBSD.org@localhost>
date: Fri Oct 22 13:21:58 2021 +0000
description:
Update to dhcpcd-9.4.1 with the following changes:
* BSD: Find the correct interface for tunnelled routes
* OpenBSD: Fix uniqueness of routes for matching priorities
* Linux: Support more platforms for seccomp (thanks to Fabrice Fontaine)
* eloop: Process all waiting fd's as they come in
* control: Unlink sockets when not in privsep
* privsep: Renamed Master to Manager
* privsep: Renamed Privilged Actioneer to Privileged Proxy
* privsep: Fix getting interface VLANID on BSD
* privsep: Enforce proper alignment of serialized struct cmsghdr
* IPv4LL: Don't remove statically assigned addresses
* routes: Fix route comparision for network prefixes with different masks
* DHCP6: Only send FQDN for SOLICIT, REQUEST, RENEW, or REBIND messages
* DHCP6: Don't spam the log when a RA repeatedly triggers an INFORM
* DHCP: Fix infinite INFORM messages
diffstat:
external/bsd/dhcpcd/dist/LICENSE | 2 +-
external/bsd/dhcpcd/dist/README.md | 12 +-
external/bsd/dhcpcd/dist/hooks/50-ypbind | 84 +
external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks | 352 +++++++
external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8 | 234 ++++
external/bsd/dhcpcd/dist/src/arp.c | 2 +-
external/bsd/dhcpcd/dist/src/arp.h | 2 +-
external/bsd/dhcpcd/dist/src/auth.c | 2 +-
external/bsd/dhcpcd/dist/src/auth.h | 2 +-
external/bsd/dhcpcd/dist/src/bpf.h | 2 +-
external/bsd/dhcpcd/dist/src/common.c | 2 +-
external/bsd/dhcpcd/dist/src/common.h | 2 +-
external/bsd/dhcpcd/dist/src/control.c | 21 +-
external/bsd/dhcpcd/dist/src/control.h | 2 +-
external/bsd/dhcpcd/dist/src/defs.h | 4 +-
external/bsd/dhcpcd/dist/src/dev.h | 2 +-
external/bsd/dhcpcd/dist/src/dhcp-common.c | 2 +-
external/bsd/dhcpcd/dist/src/dhcp-common.h | 2 +-
external/bsd/dhcpcd/dist/src/dhcp.h | 2 +-
external/bsd/dhcpcd/dist/src/dhcp6.h | 3 +-
external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c | 2 +-
external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h | 2 +-
external/bsd/dhcpcd/dist/src/dhcpcd.8 | 885 ++++++++++++++++++
external/bsd/dhcpcd/dist/src/dhcpcd.conf.5 | 1004 +++++++++++++++++++++
external/bsd/dhcpcd/dist/src/dhcpcd.h | 4 +-
external/bsd/dhcpcd/dist/src/duid.c | 2 +-
external/bsd/dhcpcd/dist/src/duid.h | 2 +-
external/bsd/dhcpcd/dist/src/eloop.c | 58 +-
external/bsd/dhcpcd/dist/src/eloop.h | 2 +-
external/bsd/dhcpcd/dist/src/if-options.h | 4 +-
external/bsd/dhcpcd/dist/src/if.c | 2 +-
external/bsd/dhcpcd/dist/src/if.h | 2 +-
external/bsd/dhcpcd/dist/src/ipv4.c | 33 +-
external/bsd/dhcpcd/dist/src/ipv4.h | 4 +-
external/bsd/dhcpcd/dist/src/ipv4ll.c | 2 +-
external/bsd/dhcpcd/dist/src/ipv4ll.h | 2 +-
external/bsd/dhcpcd/dist/src/ipv6nd.h | 2 +-
external/bsd/dhcpcd/dist/src/logerr.h | 2 +-
external/bsd/dhcpcd/dist/src/privsep-bpf.c | 4 +-
external/bsd/dhcpcd/dist/src/privsep-bpf.h | 2 +-
external/bsd/dhcpcd/dist/src/privsep-bsd.c | 12 +-
external/bsd/dhcpcd/dist/src/privsep-control.c | 6 +-
external/bsd/dhcpcd/dist/src/privsep-control.h | 2 +-
external/bsd/dhcpcd/dist/src/privsep-inet.c | 20 +-
external/bsd/dhcpcd/dist/src/privsep-inet.h | 2 +-
external/bsd/dhcpcd/dist/src/privsep-root.c | 16 +-
external/bsd/dhcpcd/dist/src/privsep-root.h | 2 +-
external/bsd/dhcpcd/dist/src/privsep.h | 6 +-
external/bsd/dhcpcd/dist/src/route.c | 30 +-
external/bsd/dhcpcd/dist/src/route.h | 2 +-
external/bsd/dhcpcd/dist/src/sa.c | 2 +-
external/bsd/dhcpcd/dist/src/sa.h | 2 +-
external/bsd/dhcpcd/dist/src/script.h | 2 +-
53 files changed, 2744 insertions(+), 116 deletions(-)
diffs (truncated from 3655 to 300 lines):
diff -r 37d0065c5c80 -r 934878691e6d external/bsd/dhcpcd/dist/LICENSE
--- a/external/bsd/dhcpcd/dist/LICENSE Fri Oct 22 06:20:47 2021 +0000
+++ b/external/bsd/dhcpcd/dist/LICENSE Fri Oct 22 13:21:58 2021 +0000
@@ -1,4 +1,4 @@
-Copyright (c) 2006-2020 Roy Marples <roy%marples.name@localhost>
+Copyright (c) 2006-2021 Roy Marples <roy%marples.name@localhost>
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff -r 37d0065c5c80 -r 934878691e6d external/bsd/dhcpcd/dist/README.md
--- a/external/bsd/dhcpcd/dist/README.md Fri Oct 22 06:20:47 2021 +0000
+++ b/external/bsd/dhcpcd/dist/README.md Fri Oct 22 13:21:58 2021 +0000
@@ -22,14 +22,9 @@
See [BUILDING.md](BUILDING.md) for how to build dhcpcd.
-If you wish to file a support ticket or help out with development, please
-[visit the Development Area](https://dev.marples.name/project/profile/101/)
-or join the mailing list below.
-
## Configuration
-You should read the
-[dhcpcd.conf man page](http://roy.marples.name/man/html5/dhcpcd.conf.html)
+You should read the dhcpcd.conf man page
and put your options into `/etc/dhcpcd.conf`.
The default configuration file should work for most people just fine.
Here it is, in case you lose it.
@@ -78,7 +73,8 @@
slaac private
```
-The [dhcpcd man page](/man/html8/dhcpcd.html) has a lot of the same options and more, which only apply to calling dhcpcd from the command line.
+The dhcpcd man page has a lot of the same options and more,
+which only apply to calling dhcpcd from the command line.
## Compatibility
@@ -96,5 +92,5 @@
## ChangeLog
We no longer supply a ChangeLog.
However, you're more than welcome to read the
-[commit log](http://roy.marples.name/git/dhcpcd.git/log/) and
+[commit log](https://roy.marples.name/git/dhcpcd/log) and
[archived release announcements](http://roy.marples.name/archives/dhcpcd-discuss/).
diff -r 37d0065c5c80 -r 934878691e6d external/bsd/dhcpcd/dist/hooks/50-ypbind
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/50-ypbind Fri Oct 22 13:21:58 2021 +0000
@@ -0,0 +1,84 @@
+# Sample dhcpcd hook for ypbind
+# This script is only suitable for the BSD versions.
+
+: ${ypbind_restart_cmd:=service_command ypbind restart}
+: ${ypbind_stop_cmd:=service_condcommand ypbind stop}
+ypbind_dir="$state_dir/ypbind"
+: ${ypdomain_dir:=/var/yp}
+: ${ypdomain_suffix:=.ypservers}
+
+best_domain()
+{
+ for i in "$ypbind_dir/$interface_order".*; do
+ if [ -f "$i" ]; then
+ cat "$i"
+ return 0
+ fi
+ done
+ return 1
+}
+
+make_yp_binding()
+{
+ [ -d "$ypbind_dir" ] || mkdir -p "$ypbind_dir"
+ echo "$new_nis_domain" >"$ypbind_dir/$ifname"
+
+ if [ -z "$ypdomain_dir" ]; then
+ false
+ else
+ cf="$ypdomain_dir/$new_nis_domain$ypdomain_suffix"
+ if [ -n "$new_nis_servers" ]; then
+ ncf="$cf.$ifname"
+ rm -f "$ncf"
+ for x in $new_nis_servers; do
+ echo "$x" >>"$ncf"
+ done
+ change_file "$cf" "$ncf"
+ else
+ [ -e "$cf" ] && rm "$cf"
+ fi
+ fi
+
+ nd="$(best_domain)"
+ if [ $? = 0 ] && [ "$nd" != "$(domainname)" ]; then
+ domainname "$nd"
+ if [ -n "$ypbind_restart_cmd" ]; then
+ eval $ypbind_restart_cmd
+ fi
+ fi
+}
+
+restore_yp_binding()
+{
+ rm -f "$ypbind_dir/$ifname"
+ nd="$(best_domain)"
+ # We need to stop ypbind if there is no best domain
+ # otherwise it will just stall as we cannot set domainname
+ # to blank :/
+ if [ -z "$nd" ]; then
+ if [ -n "$ypbind_stop_cmd" ]; then
+ eval $ypbind_stop_cmd
+ fi
+ elif [ "$nd" != "$(domainname)" ]; then
+ domainname "$nd"
+ if [ -n "$ypbind_restart_cmd" ]; then
+ eval $ypbind_restart_cmd
+ fi
+ fi
+}
+
+if ! $if_configured; then
+ ;
+elif [ "$reason" = PREINIT ]; then
+ rm -f "$ypbind_dir/$interface".*
+elif $if_up || $if_down; then
+ if [ -n "$new_nis_domain" ]; then
+ if valid_domainname "$new_nis_domain"; then
+ make_yp_binding
+ else
+ syslog err "Invalid NIS domain name: $new_nis_domain"
+ fi
+ elif [ -n "$old_nis_domain" ]; then
+ restore_yp_binding
+ fi
+fi
diff -r 37d0065c5c80 -r 934878691e6d external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks Fri Oct 22 13:21:58 2021 +0000
@@ -0,0 +1,352 @@
+#!/bin/sh
+# dhcpcd client configuration script
+
+# Handy variables and functions for our hooks to use
+ifname="$interface${protocol+.}$protocol"
+from=from
+signature_base="# Generated by dhcpcd"
+signature="$signature_base $from $ifname"
+signature_base_end="# End of dhcpcd"
+signature_end="$signature_base_end $from $ifname"
+state_dir=/var/run/dhcpcd/hook-state
+_detected_init=false
+
+: ${if_up:=false}
+: ${if_down:=false}
+: ${syslog_debug:=false}
+
+# Ensure that all arguments are unique
+uniqify()
+{
+ result=
+ for i do
+ case " $result " in
+ *" $i "*);;
+ *) result="$result${result:+ }$i";;
+ esac
+ done
+ echo "$result"
+}
+
+# List interface config files in a directory.
+# If dhcpcd is running as a single instance then it will have a list of
+# interfaces in the preferred order.
+# Otherwise we just use what we have.
+list_interfaces()
+{
+ ifaces=
+ for i in $interface_order; do
+ for x in "$1"/$i.*; do
+ [ -f "$x" ] && ifaces="$ifaces${ifaces:+ }${x##*/}"
+ done
+ done
+ for x in "$1"/*; do
+ [ -f "$x" ] && ifaces="$ifaces${ifaces:+ }${x##*/}"
+ done
+ uniqify $ifaces
+}
+
+# Trim function
+trim()
+{
+ var="$*"
+ var=${var#"${var%%[![:space:]]*}"}
+ var=${var%"${var##*[![:space:]]}"}
+ if [ -z "$var" ]; then
+ # So it seems our shell doesn't support wctype(3) patterns
+ # Fall back to sed
+ var=$(echo "$*" | sed -e 's/^[[:space:]]*//;s/[[:space:]]*$//')
+ fi
+ printf %s "$var"
+}
+
+# We normally use sed to extract values using a key from a list of files
+# but sed may not always be available at the time.
+key_get_value()
+{
+ key="$1"
+ shift
+
+ if type sed >/dev/null 2>&1; then
+ sed -n "s/^$key//p" $@
+ else
+ for x do
+ while read line; do
+ case "$line" in
+ "$key"*) echo "${line##$key}";;
+ esac
+ done < "$x"
+ done
+ fi
+}
+
+# We normally use sed to remove markers from a configuration file
+# but sed may not always be available at the time.
+remove_markers()
+{
+ m1="$1"
+ m2="$2"
+ in_marker=0
+
+ shift; shift
+ if type sed >/dev/null 2>&1; then
+ sed "/^$m1/,/^$m2/d" $@
+ else
+ for x do
+ while read line; do
+ case "$line" in
+ "$m1"*) in_marker=1;;
+ "$m2"*) in_marker=0;;
+ *) [ $in_marker = 0 ] && echo "$line";;
+ esac
+ done < "$x"
+ done
+ fi
+}
+
+# Compare two files.
+comp_file()
+{
+ [ -e "$1" ] && [ -e "$2" ] || return 1
+
+ if type cmp >/dev/null 2>&1; then
+ cmp -s "$1" "$2"
+ elif type diff >/dev/null 2>&1; then
+ diff -q "$1" "$2" >/dev/null
+ else
+ # Hopefully we're only working on small text files ...
+ [ "$(cat "$1")" = "$(cat "$2")" ]
+ fi
+}
+
+# Compare two files.
+# If different, replace first with second otherwise remove second.
+change_file()
+{
+ if [ -e "$1" ]; then
+ if comp_file "$1" "$2"; then
+ rm -f "$2"
+ return 1
+ fi
+ fi
+ cat "$2" > "$1"
+ rm -f "$2"
+ return 0
+}
+
+# Compare two files.
+# If different, copy or link depending on target type
+copy_file()
+{
+ if [ -h "$2" ]; then
+ [ "$(readlink "$2")" = "$1" ] && return 1
+ ln -sf "$1" "$2"
+ else
+ comp_file "$1" "$2" && return 1
+ cat "$1" >"$2"
+ fi
+}
+
+# Save a config file
+save_conf()
+{
+ if [ -f "$1" ]; then
+ rm -f "$1-pre.$interface"
+ cat "$1" > "$1-pre.$interface"
+ fi
+}
+
+# Restore a config file
+restore_conf()
+{
+ [ -f "$1-pre.$interface" ] || return 1
+ cat "$1-pre.$interface" > "$1"
Home |
Main Index |
Thread Index |
Old Index