Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/ROY]: src/external/bsd/dhcpcd/dist Update to dhcpcd-10.0.1 with the foll...



details:   https://anonhg.NetBSD.org/src/rev/87199ad09389
branches:  ROY
changeset: 374395:87199ad09389
user:      roy <roy%NetBSD.org@localhost>
date:      Fri Apr 21 16:52:28 2023 +0000

description:
Update to dhcpcd-10.0.1 with the following changes:

 * privsep: keep resources open rather than open/close
 * dhcp6: OPTION_NTP_SERVER is now preferred over OPTION_SNTP_SERVER
 * Misc bug fixes mainly around privsep for many platforms.
 * Fix for reading the some BSD routing table entries.
 * Fix reading authtokens from config.

Big new release, mainly around better privsep process management
which allows us to detect when they exit unexpectedly.

diffstat:

 external/bsd/dhcpcd/dist/LICENSE                  |    2 +-
 external/bsd/dhcpcd/dist/README.md                |   10 +-
 external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant  |    4 +-
 external/bsd/dhcpcd/dist/hooks/20-resolv.conf     |    2 +-
 external/bsd/dhcpcd/dist/hooks/29-lookup-hostname |    6 +-
 external/bsd/dhcpcd/dist/hooks/30-hostname        |    4 +-
 external/bsd/dhcpcd/dist/hooks/50-ntp.conf        |    6 +-
 external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks   |   18 +-
 external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8 |   29 +-
 external/bsd/dhcpcd/dist/src/arp.c                |   34 +-
 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.c                |   38 +-
 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            |  198 ++--
 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.c               |   81 +-
 external/bsd/dhcpcd/dist/src/dhcp.h               |    2 +-
 external/bsd/dhcpcd/dist/src/dhcp6.c              |  102 +-
 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             |   22 +-
 external/bsd/dhcpcd/dist/src/dhcpcd.c             |  184 ++-
 external/bsd/dhcpcd/dist/src/dhcpcd.conf.5        |   30 +-
 external/bsd/dhcpcd/dist/src/dhcpcd.h             |   19 +-
 external/bsd/dhcpcd/dist/src/duid.c               |   13 +-
 external/bsd/dhcpcd/dist/src/duid.h               |    2 +-
 external/bsd/dhcpcd/dist/src/eloop.c              |  943 ++++++++++++++++-----
 external/bsd/dhcpcd/dist/src/eloop.h              |   33 +-
 external/bsd/dhcpcd/dist/src/if-bsd.c             |   82 +-
 external/bsd/dhcpcd/dist/src/if-options.c         |   74 +-
 external/bsd/dhcpcd/dist/src/if-options.h         |    5 +-
 external/bsd/dhcpcd/dist/src/if.c                 |   13 +-
 external/bsd/dhcpcd/dist/src/if.h                 |   31 +-
 external/bsd/dhcpcd/dist/src/ipv4.c               |    2 +-
 external/bsd/dhcpcd/dist/src/ipv4.h               |    2 +-
 external/bsd/dhcpcd/dist/src/ipv4ll.c             |    2 +-
 external/bsd/dhcpcd/dist/src/ipv4ll.h             |    2 +-
 external/bsd/dhcpcd/dist/src/ipv6.c               |  109 +-
 external/bsd/dhcpcd/dist/src/ipv6.h               |    2 +-
 external/bsd/dhcpcd/dist/src/ipv6nd.c             |   98 +-
 external/bsd/dhcpcd/dist/src/ipv6nd.h             |    4 +-
 external/bsd/dhcpcd/dist/src/logerr.c             |    2 +-
 external/bsd/dhcpcd/dist/src/logerr.h             |    2 +-
 external/bsd/dhcpcd/dist/src/privsep-bpf.c        |   41 +-
 external/bsd/dhcpcd/dist/src/privsep-bpf.h        |    2 +-
 external/bsd/dhcpcd/dist/src/privsep-bsd.c        |  221 ++++-
 external/bsd/dhcpcd/dist/src/privsep-control.c    |   81 +-
 external/bsd/dhcpcd/dist/src/privsep-control.h    |    2 +-
 external/bsd/dhcpcd/dist/src/privsep-inet.c       |  188 ++-
 external/bsd/dhcpcd/dist/src/privsep-inet.h       |    2 +-
 external/bsd/dhcpcd/dist/src/privsep-root.c       |  288 ++++-
 external/bsd/dhcpcd/dist/src/privsep-root.h       |    9 +-
 external/bsd/dhcpcd/dist/src/privsep.c            |  413 +++++++--
 external/bsd/dhcpcd/dist/src/privsep.h            |   56 +-
 external/bsd/dhcpcd/dist/src/route.c              |    5 +-
 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.c             |    2 +-
 external/bsd/dhcpcd/dist/src/script.h             |    2 +-
 69 files changed, 2434 insertions(+), 1127 deletions(-)

diffs (truncated from 7126 to 300 lines):

diff -r 020c477c9a64 -r 87199ad09389 external/bsd/dhcpcd/dist/LICENSE
--- a/external/bsd/dhcpcd/dist/LICENSE  Fri Oct 22 13:21:58 2021 +0000
+++ b/external/bsd/dhcpcd/dist/LICENSE  Fri Apr 21 16:52:28 2023 +0000
@@ -1,4 +1,4 @@
-Copyright (c) 2006-2021 Roy Marples <roy%marples.name@localhost>
+Copyright (c) 2006-2023 Roy Marples <roy%marples.name@localhost>
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
diff -r 020c477c9a64 -r 87199ad09389 external/bsd/dhcpcd/dist/README.md
--- a/external/bsd/dhcpcd/dist/README.md        Fri Oct 22 13:21:58 2021 +0000
+++ b/external/bsd/dhcpcd/dist/README.md        Fri Apr 21 16:52:28 2023 +0000
@@ -1,11 +1,11 @@
 # dhcpcd
 
 dhcpcd is a
-[DHCP](http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol) and a
-[DHCPv6](http://en.wikipedia.org/wiki/DHCPv6) client.
-It's also an IPv4LL (aka [ZeroConf](http://en.wikipedia.org/wiki/Zeroconf))
+[DHCP](https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol) and a
+[DHCPv6](https://en.wikipedia.org/wiki/DHCPv6) client.
+It's also an IPv4LL (aka [ZeroConf](https://en.wikipedia.org/wiki/Zeroconf))
 client.
-In layman's terms, dhcpcd runs on your machine and silently configures your
+In layperson's terms, dhcpcd runs on your machine and silently configures your
 computer to work on the attached networks without trouble and mostly without
 configuration.
 
@@ -93,4 +93,4 @@ dhcpcd-9 defaults the run directory to `
 We no longer supply a ChangeLog.
 However, you're more than welcome to read the
 [commit log](https://roy.marples.name/git/dhcpcd/log) and
-[archived release announcements](http://roy.marples.name/archives/dhcpcd-discuss/).
+[archived release announcements](https://roy.marples.name/archives/dhcpcd-discuss/).
diff -r 020c477c9a64 -r 87199ad09389 external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
--- a/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant  Fri Oct 22 13:21:58 2021 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant  Fri Apr 21 16:52:28 2023 +0000
@@ -102,8 +102,8 @@ wpa_supplicant_stop()
 }
 
 if [ "$ifwireless" = "1" ] && \
-    type wpa_supplicant >/dev/null 2>&1 && \
-    type wpa_cli >/dev/null 2>&1
+    command -v wpa_supplicant >/dev/null 2>&1 && \
+    command -v wpa_cli >/dev/null 2>&1
 then
        case "$reason" in
        PREINIT)        wpa_supplicant_start;;
diff -r 020c477c9a64 -r 87199ad09389 external/bsd/dhcpcd/dist/hooks/20-resolv.conf
--- a/external/bsd/dhcpcd/dist/hooks/20-resolv.conf     Fri Oct 22 13:21:58 2021 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/20-resolv.conf     Fri Apr 21 16:52:28 2023 +0000
@@ -11,7 +11,7 @@ nocarrier_roaming_dir="$state_dir/roamin
 NL="
 "
 : ${resolvconf:=resolvconf}
-if type "$resolvconf" >/dev/null 2>&1; then
+if command -v "$resolvconf" >/dev/null 2>&1; then
        have_resolvconf=true
 else
        have_resolvconf=false
diff -r 020c477c9a64 -r 87199ad09389 external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
--- a/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname Fri Oct 22 13:21:58 2021 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname Fri Apr 21 16:52:28 2023 +0000
@@ -4,20 +4,20 @@ lookup_hostname()
 {
        [ -z "$new_ip_address" ] && return 1
        # Silly ISC programs love to send error text to stdout
-       if type dig >/dev/null 2>&1; then
+       if command -v dig >/dev/null 2>&1; then
                h=$(dig +short -x $new_ip_address)
                if [ $? = 0 ]; then
                        echo "$h" | sed 's/\.$//'
                        return 0
                fi
-       elif type host >/dev/null 2>&1; then
+       elif command -v host >/dev/null 2>&1; then
                h=$(host $new_ip_address)
                if [ $? = 0 ]; then 
                        echo "$h" \
                        | sed 's/.* domain name pointer \(.*\)./\1/'
                        return 0
                fi
-       elif type getent >/dev/null 2>&1; then
+       elif command -v getent >/dev/null 2>&1; then
                h=$(getent hosts $new_ip_address)
                if [ $? = 0 ]; then
                        echo "$h" | sed 's/[^ ]* *\([^ ]*\).*/\1/'
diff -r 020c477c9a64 -r 87199ad09389 external/bsd/dhcpcd/dist/hooks/30-hostname
--- a/external/bsd/dhcpcd/dist/hooks/30-hostname        Fri Oct 22 13:21:58 2021 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/30-hostname        Fri Apr 21 16:52:28 2023 +0000
@@ -25,7 +25,7 @@
        if [ -z "${1+x}" ]; then
                if [ -r /proc/sys/kernel/hostname ]; then
                        read name </proc/sys/kernel/hostname && echo "$name"
-               elif type hostname >/dev/null 2>/dev/null; then
+               elif command -v hostname >/dev/null 2>/dev/null; then
                        hostname
                elif sysctl kern.hostname >/dev/null 2>&1; then
                        sysctl -n kern.hostname
@@ -39,7 +39,7 @@
 
        if [ -w /proc/sys/kernel/hostname ]; then
                echo "$1" >/proc/sys/kernel/hostname
-       elif [ -n "$1" ] && type hostname >/dev/null 2>&1; then
+       elif [ -n "$1" ] && command -v hostname >/dev/null 2>&1; then
                hostname "$1"
        elif sysctl kern.hostname >/dev/null 2>&1; then
                sysctl -w "kern.hostname=$1" >/dev/null
diff -r 020c477c9a64 -r 87199ad09389 external/bsd/dhcpcd/dist/hooks/50-ntp.conf
--- a/external/bsd/dhcpcd/dist/hooks/50-ntp.conf        Fri Oct 22 13:21:58 2021 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/50-ntp.conf        Fri Apr 21 16:52:28 2023 +0000
@@ -43,7 +43,7 @@ fi
 
 # Debian has a separate file for DHCP config to avoid stamping on
 # the master.
-if [ "$ntp_service" = ntpd ] && type invoke-rc.d >/dev/null 2>&1; then
+if [ "$ntp_service" = ntpd ] && command -v invoke-rc.d >/dev/null 2>&1; then
        [ -e /var/lib/ntp ] || mkdir /var/lib/ntp
        : ${ntp_service:=ntp}
        : ${NTP_DHCP_CONF:=/var/lib/ntp/ntp.conf.dhcp}
@@ -113,7 +113,7 @@ add_ntp_conf()
        [ -e "$cf" ] && rm "$cf"
        [ -d "$ntp_conf_dir" ] || mkdir -p "$ntp_conf_dir"
        if [ -n "$new_ntp_servers" ]; then
-               for x in $new_ntp_servers; do
+               for x in $(uniqify $new_ntp_servers); do
                        echo "server $x" >> "$cf"
                done
        fi
@@ -131,7 +131,7 @@ remove_ntp_conf()
 # For ease of use, map DHCP6 names onto our DHCP4 names
 case "$reason" in
 BOUND6|RENEW6|REBIND6|REBOOT6|INFORM6)
-       new_ntp_servers="$new_dhcp6_sntp_servers"
+       new_ntp_servers="$new_dhcp6_sntp_servers $new_dhcp6_ntp_server_addr $new_dhcp6_ntp_server_fqdn"
 ;;
 esac
 
diff -r 020c477c9a64 -r 87199ad09389 external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks
--- a/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks   Fri Oct 22 13:21:58 2021 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks   Fri Apr 21 16:52:28 2023 +0000
@@ -67,7 +67,7 @@ key_get_value()
        key="$1"
        shift
 
-       if type sed >/dev/null 2>&1; then
+       if command -v sed >/dev/null 2>&1; then
                sed -n "s/^$key//p" $@
        else
                for x do
@@ -89,7 +89,7 @@ remove_markers()
        in_marker=0
 
        shift; shift
-       if type sed >/dev/null 2>&1; then
+       if command -v sed >/dev/null 2>&1; then
                sed "/^$m1/,/^$m2/d" $@
        else
                for x do
@@ -109,9 +109,9 @@ comp_file()
 {
        [ -e "$1" ] && [ -e "$2" ] || return 1
 
-       if type cmp >/dev/null 2>&1; then
+       if command -v cmp >/dev/null 2>&1; then
                cmp -s "$1" "$2"
-       elif type diff >/dev/null 2>&1; then
+       elif command -v diff >/dev/null 2>&1; then
                diff -q "$1" "$2" >/dev/null
        else
                # Hopefully we're only working on small text files ...
@@ -178,7 +178,7 @@ syslog()
        err|error)      echo "$interface: $*" >&2;;
        *)              echo "$interface: $*";;
        esac
-       if type logger >/dev/null 2>&1; then
+       if command -v logger >/dev/null 2>&1; then
                logger -i -p daemon."$lvl" -t dhcpcd-run-hooks "$interface: $*"
        fi
 }
@@ -234,11 +234,11 @@ detect_init()
        if [ -x /bin/systemctl ] && [ -S /run/systemd/private ]; then
                _service_exists="/bin/systemctl --quiet is-enabled \$1.service"
                _service_status="/bin/systemctl --quiet is-active \$1.service"
-               _service_cmd="/bin/systemctl \$2 \$1.service"
+               _service_cmd="/bin/systemctl \$2 --no-block \$1.service"
        elif [ -x /usr/bin/systemctl ] && [ -S /run/systemd/private ]; then
                _service_exists="/usr/bin/systemctl --quiet is-enabled \$1.service"
                _service_status="/usr/bin/systemctl --quiet is-active \$1.service"
-               _service_cmd="/usr/bin/systemctl \$2 \$1.service"
+               _service_cmd="/usr/bin/systemctl \$2 --no-block \$1.service"
        elif [ -x /sbin/rc-service ] &&
             { [ -s /libexec/rc/init.d/softlevel ] ||
             [ -s /run/openrc/softlevel ]; }
@@ -338,9 +338,11 @@ for hook in \
        /libexec/dhcpcd-hooks/* \
        /etc/dhcpcd.exit-hook
 do
+       case "$hook" in
+               */*~)   continue;;
+       esac
        for skip in $skip_hooks; do
                case "$hook" in
-                       */*~)                           continue 2;;
                        */"$skip")                      continue 2;;
                        */[0-9][0-9]"-$skip")           continue 2;;
                        */[0-9][0-9]"-$skip.sh")        continue 2;;
diff -r 020c477c9a64 -r 87199ad09389 external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8
--- a/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8 Fri Oct 22 13:21:58 2021 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8 Fri Apr 21 16:52:28 2023 +0000
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2006-2021 Roy Marples
+.\" Copyright (c) 2006-2023 Roy Marples
 .\" All rights reserved
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd December 27, 2020
+.Dd August 31, 2022
 .Dt DHCPCD-RUN-HOOKS 8
 .Os
 .Sh NAME
@@ -68,15 +68,14 @@ is set to the interface that
 .Nm dhcpcd
 is run on and
 .Ev $reason
-is to the reason why
-q
+is set to the reason why
 .Nm
 was invoked.
 DHCP information to be configured is held in variables starting with the word
 new_ and old DHCP information to be removed is held in variables starting with
 the word old_.
 .Nm dhcpcd
-can display the full list of variables it knows how about by using the
+can display the full list of variables it knows about by using the
 .Fl V , -variables
 argument.
 .Pp
@@ -85,7 +84,7 @@ Here's a list of reasons why
 could be invoked:
 .Bl -tag -width EXPIREXXXEXPIRE6
 .It Dv PREINIT
-dhcpcd is starting up and any pre-initialisation should be done.
+dhcpcd is starting up and any pre-initialisation required should be performed now.
 .It Dv CARRIER
 dhcpcd has detected the carrier is up.
 This is generally just a notification and no action need be taken.
@@ -94,14 +93,14 @@ dhcpcd lost the carrier.
 The cable may have been unplugged or association to the wireless point lost.
 .It Dv NOCARRIER_ROAMING
 dhcpcd lost the carrier but the interface configuration is persisted.
-The OS has to support wireless roaming or IP Persistance for this to happen.
+The OS has to support wireless roaming or IP Persistence for this to happen.
 .It Dv INFORM | Dv INFORM6
 dhcpcd informed a DHCP server about its address and obtained other
 configuration details.
 .It Dv BOUND | Dv BOUND6
 dhcpcd obtained a new lease from a DHCP server.
 .It Dv RENEW | Dv RENEW6
-dhcpcd renewed it's lease.
+dhcpcd renewed its lease.
 .It Dv REBIND | Dv REBIND6
 dhcpcd has rebound to a new DHCP server.
 .It Dv REBOOT | Dv REBOOT6
@@ -181,7 +180,7 @@ flags.
 .Ev $interface
 MTU.
 .It Ev $ifssid
-the name of the SSID the
+the SSID the
 .Ev interface
 is connected to.
 .It Ev $interface_order
@@ -207,24 +206,24 @@ Address family waiting for, as defined i
 the name of the profile selected from
 .Xr dhcpcd.conf 5 .
 .It Ev $new_delegated_dhcp6_prefix
-space separated list of delegated prefixes.
+space-separated list of delegated prefixes.
 .El
 .Sh FILES
 When
 .Nm
 runs, it loads
-.Pa /etc/dhcpcd.enter-hook
-and any scripts found in
+.Pa /etc/dhcpcd.enter-hook ,
+any scripts found in
 .Pa /libexec/dhcpcd-hooks
-in a lexical order and then finally
-.Pa /etc/dhcpcd.exit-hook
+in lexical order, then finally
+.Pa /etc/dhcpcd.exit-hook .
 .Sh SEE ALSO
 .Xr dhcpcd 8



Home | Main Index | Thread Index | Old Index