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/22179ee1c670
branches:  roy
changeset: 989976:22179ee1c670
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/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.c          |   54 +++++-----
 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/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 +-
 50 files changed, 325 insertions(+), 233 deletions(-)

diffs (truncated from 1732 to 300 lines):

diff -r 70a17cf2b4ee -r 22179ee1c670 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 70a17cf2b4ee -r 22179ee1c670 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 70a17cf2b4ee -r 22179ee1c670 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 70a17cf2b4ee -r 22179ee1c670 external/bsd/dhcpcd/dist/src/arp.c
--- a/external/bsd/dhcpcd/dist/src/arp.c        Mon Dec 28 13:56:25 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/arp.c        Fri Oct 22 13:21:58 2021 +0000
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-2-Clause */
 /*
  * dhcpcd - ARP handler
- * 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 70a17cf2b4ee -r 22179ee1c670 external/bsd/dhcpcd/dist/src/arp.h
--- a/external/bsd/dhcpcd/dist/src/arp.h        Mon Dec 28 13:56:25 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/arp.h        Fri Oct 22 13:21:58 2021 +0000
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-2-Clause */
 /*
  * dhcpcd - DHCP client daemon
- * 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 70a17cf2b4ee -r 22179ee1c670 external/bsd/dhcpcd/dist/src/auth.c
--- a/external/bsd/dhcpcd/dist/src/auth.c       Mon Dec 28 13:56:25 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/auth.c       Fri Oct 22 13:21:58 2021 +0000
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-2-Clause */
 /*
  * dhcpcd - DHCP client daemon
- * 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 70a17cf2b4ee -r 22179ee1c670 external/bsd/dhcpcd/dist/src/auth.h
--- a/external/bsd/dhcpcd/dist/src/auth.h       Mon Dec 28 13:56:25 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/auth.h       Fri Oct 22 13:21:58 2021 +0000
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-2-Clause */
 /*
  * dhcpcd - DHCP client daemon
- * 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 70a17cf2b4ee -r 22179ee1c670 external/bsd/dhcpcd/dist/src/bpf.c
--- a/external/bsd/dhcpcd/dist/src/bpf.c        Mon Dec 28 13:56:25 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/bpf.c        Fri Oct 22 13:21:58 2021 +0000
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-2-Clause */
 /*
  * dhcpcd: BPF arp and bootp filtering
- * 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 70a17cf2b4ee -r 22179ee1c670 external/bsd/dhcpcd/dist/src/bpf.h
--- a/external/bsd/dhcpcd/dist/src/bpf.h        Mon Dec 28 13:56:25 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/bpf.h        Fri Oct 22 13:21:58 2021 +0000
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-2-Clause */
 /*
  * dhcpcd: BPF arp and bootp filtering
- * 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 70a17cf2b4ee -r 22179ee1c670 external/bsd/dhcpcd/dist/src/common.c
--- a/external/bsd/dhcpcd/dist/src/common.c     Mon Dec 28 13:56:25 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/common.c     Fri Oct 22 13:21:58 2021 +0000
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-2-Clause */
 /*
  * dhcpcd - DHCP client daemon
- * 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 70a17cf2b4ee -r 22179ee1c670 external/bsd/dhcpcd/dist/src/common.h
--- a/external/bsd/dhcpcd/dist/src/common.h     Mon Dec 28 13:56:25 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/common.h     Fri Oct 22 13:21:58 2021 +0000
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-2-Clause */
 /*
  * dhcpcd - DHCP client daemon
- * 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 70a17cf2b4ee -r 22179ee1c670 external/bsd/dhcpcd/dist/src/control.c
--- a/external/bsd/dhcpcd/dist/src/control.c    Mon Dec 28 13:56:25 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/control.c    Fri Oct 22 13:21:58 2021 +0000
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-2-Clause */
 /*
  * dhcpcd - DHCP client daemon
- * 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
@@ -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
@@ -84,7 +84,8 @@
                fd->ctx->ps_control_client = NULL;
 #endif
 
-       eloop_event_remove_writecb(fd->ctx->eloop, fd->fd);
+       if (eloop_event_remove_writecb(fd->ctx->eloop, fd->fd) == -1)
+               logerr(__func__);
        TAILQ_REMOVE(&fd->ctx->control_fds, fd, next);
        control_queue_free(fd);
        free(fd);
@@ -350,12 +351,12 @@
        }
 #endif
 
-       if ((fmode & S_PRIV) == S_PRIV)
+       if ((fmode & S_UNPRIV) == S_UNPRIV)
+               strlcpy(ctx->control_sock_unpriv, sa.sun_path,
+                   sizeof(ctx->control_sock_unpriv));



Home | Main Index | Thread Index | Old Index