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-9.4.1 with the follo...



details:   https://anonhg.NetBSD.org/src/rev/020c477c9a64
branches:  ROY
changeset: 989971:020c477c9a64
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/30-hostname        |    55 +-
 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.c                |     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.c               |    44 +-
 external/bsd/dhcpcd/dist/src/dhcp.h               |     2 +-
 external/bsd/dhcpcd/dist/src/dhcp6.c              |   125 +-
 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.c             |    54 +-
 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-bsd.c             |     5 +-
 external/bsd/dhcpcd/dist/src/if-options.c         |    22 +-
 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/ipv6.c               |     4 +-
 external/bsd/dhcpcd/dist/src/ipv6.h               |     2 +-
 external/bsd/dhcpcd/dist/src/ipv6nd.c             |     2 +-
 external/bsd/dhcpcd/dist/src/ipv6nd.h             |     2 +-
 external/bsd/dhcpcd/dist/src/logerr.c             |     9 +-
 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.c            |    71 +-
 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.c             |     5 +-
 external/bsd/dhcpcd/dist/src/script.h             |     2 +-
 66 files changed, 2974 insertions(+), 286 deletions(-)

diffs (truncated from 4789 to 300 lines):

diff -r 0893b9f3100b -r 020c477c9a64 external/bsd/dhcpcd/dist/LICENSE
--- a/external/bsd/dhcpcd/dist/LICENSE  Mon Dec 28 13:56:25 2020 +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 0893b9f3100b -r 020c477c9a64 external/bsd/dhcpcd/dist/README.md
--- a/external/bsd/dhcpcd/dist/README.md        Mon Dec 28 13:56:25 2020 +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 0893b9f3100b -r 020c477c9a64 external/bsd/dhcpcd/dist/hooks/30-hostname
--- a/external/bsd/dhcpcd/dist/hooks/30-hostname        Mon Dec 28 13:56:25 2020 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/30-hostname        Fri Oct 22 13:21:58 2021 +0000
@@ -17,16 +17,16 @@
 
 # If we used to set the hostname, but relinquish control of it, we should
 # reset to the default value.
-: ${hostname_default=localhost}
+: ${hostname_default=}
 
 # Some systems don't have hostname(1)
 _hostname()
 {
        if [ -z "${1+x}" ]; then
-               if type hostname >/dev/null 2>&1; 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
                        hostname
-               elif [ -r /proc/sys/kernel/hostname ]; then
-                       read name </proc/sys/kernel/hostname && echo "$name"
                elif sysctl kern.hostname >/dev/null 2>&1; then
                        sysctl -n kern.hostname
                elif sysctl kernel.hostname >/dev/null 2>&1; then
@@ -37,48 +37,39 @@
                return $?
        fi
 
-       # Always prefer hostname(1) if we have it
-       if type hostname >/dev/null 2>&1; then
+       if [ -w /proc/sys/kernel/hostname ]; then
+               echo "$1" >/proc/sys/kernel/hostname
+       elif [ -n "$1" ] && type hostname >/dev/null 2>&1; then
                hostname "$1"
-       elif [ -w /proc/sys/kernel/hostname ]; then
-               echo "$1" >/proc/sys/kernel/hostname
        elif sysctl kern.hostname >/dev/null 2>&1; then
-               sysctl -w "kern.hostname=$1"
+               sysctl -w "kern.hostname=$1" >/dev/null
        elif sysctl kernel.hostname >/dev/null 2>&1; then
-               sysctl -w "kernel.hostname=$1"
+               sysctl -w "kernel.hostname=$1" >/dev/null
        else
-               # We know this will fail, but it will now fail
-               # with an error to stdout
+               # May fail to set a blank hostname
                hostname "$1"
        fi
 }
 
-set_hostname_vars()
+is_default_hostname()
 {
-       hfqdn=false
-       hshort=false
-       case "$hostname_fqdn" in
-       [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1)        hfqdn=true;;
-       ""|[Ss][Ee][Rr][Vv][Ee][Rr])            ;;
-       *)                                      hshort=true;;
+       case "$1" in
+       ""|"$hostname_default"|localhost|localhost.localdomain)
+               return 0;;
        esac
+       return 1
 }
 
 need_hostname()
 {
        # Always load the hostname variable for future use
        hostname="$(_hostname)"
-       case "$hostname" in
-       ""|"(none)"|localhost|localhost.localdomain|"$hostname_default")
-               return 0;;
-       esac
+       is_default_hostname "$hostname" && return 0
 
        case "$force_hostname" in
        [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1) return 0;;
        esac
 
-       set_hostname_vars
-
        if [ -n "$old_fqdn" ]; then
                if ${hfqdn} || ! ${hshort}; then
                        [ "$hostname" = "$old_fqdn" ]
@@ -119,9 +110,15 @@
 
 set_hostname()
 {
-       need_hostname || return
+       hfqdn=false
+       hshort=false
+       case "$hostname_fqdn" in
+       [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1)        hfqdn=true;;
+       ""|[Ss][Ee][Rr][Vv][Ee][Rr])            ;;
+       *)                                      hshort=true;;
+       esac
 
-       set_hostname_vars
+       need_hostname || return
 
        if [ -n "$new_fqdn" ]; then
                if ${hfqdn} || ! ${hshort}; then
@@ -143,7 +140,7 @@
                else
                        try_hostname "$new_host_name"
                fi
-       elif [ -n "${hostname_default+x}" ]; then
+       elif ! is_default_hostname "$hostname"; then
                try_hostname "$hostname_default"
        fi
 }
@@ -156,6 +153,6 @@
        ;;
 esac
 
-if $if_up; then
+if $if_configured && $if_up && [ "$reason" != ROUTERADVERT ]; then
        set_hostname
 fi
diff -r 0893b9f3100b -r 020c477c9a64 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 0893b9f3100b -r 020c477c9a64 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



Home | Main Index | Thread Index | Old Index