Source-Changes-HG archive

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

[src/netbsd-9]: src/external/bsd/dhcpcd/dist Catch up to current for the foll...



details:   https://anonhg.NetBSD.org/src/rev/19f312de1840
branches:  netbsd-9
changeset: 962941:19f312de1840
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Sep 05 08:56:55 2019 +0000

description:
Catch up to current for the following files, requested by roy in ticket #177:

        external/bsd/dhcpcd/dist/BUILDING.md            up to 1.1.1.5
        external/bsd/dhcpcd/dist/Makefile               up to 1.1.1.7
        external/bsd/dhcpcd/dist/Makefile.inc           up to 1.1.1.3
        external/bsd/dhcpcd/dist/configure              up to 1.1.1.15
        external/bsd/dhcpcd/dist/compat/rb.c            up to 1.1.1.2
        external/bsd/dhcpcd/dist/compat/rbtree.h        up to 1.1.1.2
        external/bsd/dhcpcd/dist/hooks/Makefile         up to 1.1.1.2
        external/bsd/dhcpcd/dist/src/Makefile           up to 1.1.1.6
        external/bsd/dhcpcd/dist/src/bpf.c              up to 1.12
        external/bsd/dhcpcd/dist/src/control.c          up to 1.1.1.8
        external/bsd/dhcpcd/dist/src/control.h          up to 1.1.1.5
        external/bsd/dhcpcd/dist/src/defs.h             up to 1.1.1.27
        external/bsd/dhcpcd/dist/src/dhcp-common.c      up to 1.1.1.8
        external/bsd/dhcpcd/dist/src/dhcp.c             up to 1.25
        external/bsd/dhcpcd/dist/src/dhcp6.c            up to 1.12
        external/bsd/dhcpcd/dist/src/dhcpcd.8.in        up to 1.3
        external/bsd/dhcpcd/dist/src/dhcpcd.c           up to 1.25
        external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in   up to 1.1.1.14
        external/bsd/dhcpcd/dist/src/duid.c             up to 1.1.1.7
        external/bsd/dhcpcd/dist/src/if-bsd.c           up to 1.12
        external/bsd/dhcpcd/dist/src/if-linux.c         up to 1.1.1.16
        external/bsd/dhcpcd/dist/src/if-options.c       up to 1.17
        external/bsd/dhcpcd/dist/src/if-options.h       up to 1.1.1.11
        external/bsd/dhcpcd/dist/src/if-sun.c           up to 1.1.1.11
        external/bsd/dhcpcd/dist/src/if.c               up to 1.1.1.16
        external/bsd/dhcpcd/dist/src/if.h               up to 1.1.1.11
        external/bsd/dhcpcd/dist/src/ipv4.c             up to 1.1.1.17
        external/bsd/dhcpcd/dist/src/ipv4.h             up to 1.1.1.10
        external/bsd/dhcpcd/dist/src/ipv6.c             up to 1.4
        external/bsd/dhcpcd/dist/src/ipv6.h             up to 1.5
        external/bsd/dhcpcd/dist/src/ipv6nd.c           up to 1.11
        external/bsd/dhcpcd/dist/src/ipv6nd.h           up to 1.1.1.11
        external/bsd/dhcpcd/dist/src/route.c            up to 1.1.1.14
        external/bsd/dhcpcd/dist/src/route.h            up to 1.1.1.9
        external/bsd/dhcpcd/dist/src/sa.c               up to 1.1.1.6
        external/bsd/dhcpcd/dist/src/script.c           up to 1.1.1.11

Import dhcpcd-8.0.4 with the following changes:

 * BSD: Fixed router reachability tests
 * inet6: If router unreachable, just solicit a new one
 * inet6: Fon't install a default route if only lladdresses
 * inet6: Stop listening to NA messages
 * BSD: Listen to RTM_MISS messages
 * DHCP: Fix in_cksum for Big Endian
 * DHCP{,6}: Don't log an error if the lease file is truncated

Changes in dhcpcd-8.0.3:

 *  DHCP: Work with IP headers with options
 *  script: Assert that env string are correctly terminated
 *  script: Terminate env strings with no value
 *  script: Don't attempt to use an invalid env string
 *  route: Fix NULL deference error when using static routes
 *  ARP: Respect IFF_NOARP
 *  DHCP: Allow full DHCP support for PtP interfaces, but not by default
 *  control: sends correct buffer to listeners

dhcpcd-ui now correctly reports SSD association and all the addresses
obtained (regression from dhcpcd-7)

diffstat:

 external/bsd/dhcpcd/dist/BUILDING.md          |   10 +-
 external/bsd/dhcpcd/dist/Makefile             |   36 +-
 external/bsd/dhcpcd/dist/Makefile.inc         |    1 +
 external/bsd/dhcpcd/dist/compat/rb.c          |    7 +-
 external/bsd/dhcpcd/dist/compat/rbtree.h      |    7 +-
 external/bsd/dhcpcd/dist/configure            |  103 ++++++--
 external/bsd/dhcpcd/dist/hooks/Makefile       |    7 +
 external/bsd/dhcpcd/dist/src/Makefile         |   34 ++
 external/bsd/dhcpcd/dist/src/bpf.c            |   15 +
 external/bsd/dhcpcd/dist/src/control.c        |  155 +++++++----
 external/bsd/dhcpcd/dist/src/control.h        |   15 +-
 external/bsd/dhcpcd/dist/src/defs.h           |    2 +-
 external/bsd/dhcpcd/dist/src/dhcp-common.c    |   61 ++-
 external/bsd/dhcpcd/dist/src/dhcp.c           |  112 ++++----
 external/bsd/dhcpcd/dist/src/dhcp6.c          |   40 +-
 external/bsd/dhcpcd/dist/src/dhcpcd.8.in      |   25 +-
 external/bsd/dhcpcd/dist/src/dhcpcd.c         |   16 +-
 external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in |    8 +-
 external/bsd/dhcpcd/dist/src/duid.c           |   10 +-
 external/bsd/dhcpcd/dist/src/if-bsd.c         |   97 ++++--
 external/bsd/dhcpcd/dist/src/if-linux.c       |   31 +-
 external/bsd/dhcpcd/dist/src/if-options.c     |    4 +-
 external/bsd/dhcpcd/dist/src/if-options.h     |    4 +-
 external/bsd/dhcpcd/dist/src/if-sun.c         |  323 ++++++++++++++-----------
 external/bsd/dhcpcd/dist/src/if.c             |   36 ++-
 external/bsd/dhcpcd/dist/src/if.h             |    1 +
 external/bsd/dhcpcd/dist/src/ipv4.c           |   19 +-
 external/bsd/dhcpcd/dist/src/ipv4.h           |    3 +-
 external/bsd/dhcpcd/dist/src/ipv6.c           |   76 +++++-
 external/bsd/dhcpcd/dist/src/ipv6.h           |   15 +-
 external/bsd/dhcpcd/dist/src/ipv6nd.c         |  219 ++++++----------
 external/bsd/dhcpcd/dist/src/ipv6nd.h         |   15 +-
 external/bsd/dhcpcd/dist/src/route.c          |   29 +-
 external/bsd/dhcpcd/dist/src/route.h          |    2 +
 external/bsd/dhcpcd/dist/src/sa.c             |    4 +-
 external/bsd/dhcpcd/dist/src/script.c         |   45 ++-
 36 files changed, 944 insertions(+), 643 deletions(-)

diffs (truncated from 3316 to 300 lines):

diff -r d3102e6394a4 -r 19f312de1840 external/bsd/dhcpcd/dist/BUILDING.md
--- a/external/bsd/dhcpcd/dist/BUILDING.md      Thu Sep 05 08:47:02 2019 +0000
+++ b/external/bsd/dhcpcd/dist/BUILDING.md      Thu Sep 05 08:56:55 2019 +0000
@@ -134,9 +134,13 @@
 
 
 ## Importing into another source control system
-To prepare dhcpcd for import into a platform source tree (like NetBSD)
-you can use the make import target to create /tmp/dhcpcd-$version and
-populate it with all the source files and hooks needed.
+To import the full sources, use the import target.
+To import only the needed sources and documentation, use the import-src
+target.
+Both targets support DESTDIR to set the installation directory,
+if unset it defaults to `/tmp/dhcpcd-$VERSION`
+Example: `make DESTDIR=/usr/src/contrib/dhcpcd import-src`
+
 In this instance, you may wish to disable some configured tests when
 the binary has to run on older versions which lack support, such as getline.
 `./configure --without-getline`
diff -r d3102e6394a4 -r 19f312de1840 external/bsd/dhcpcd/dist/Makefile
--- a/external/bsd/dhcpcd/dist/Makefile Thu Sep 05 08:47:02 2019 +0000
+++ b/external/bsd/dhcpcd/dist/Makefile Thu Sep 05 08:56:55 2019 +0000
@@ -2,8 +2,7 @@
 
 VERSION!=      sed -n 's/\#define VERSION[[:space:]]*"\(.*\)".*/\1/p' src/defs.h
 
-DIST!=         if test -f .fslckout; then echo "dist-fossil"; \
-               elif test -d .git; then echo "dist-git"; \
+DIST!=         if test -d .git; then echo "dist-git"; \
                else echo "dist-inst"; fi
 FOSSILID?=     current
 GITREF?=       HEAD
@@ -52,12 +51,6 @@
        rm -f config.h config.mk config.log \
                ${DISTFILE} ${DISTFILEGZ} ${DISTINFO} ${DISTINFOSIGN}
 
-
-dist-fossil:
-       fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
-       gunzip -c ${DISTFILEGZ} | xz >${DISTFILE}
-       rm ${DISTFILEGZ}
-
 dist-git:
        git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE}
 
@@ -86,9 +79,28 @@
        tar cf - -C /tmp ${DISTPREFIX} | xz >${DISTFILE}
        ls -l ${DISTFILE}
 
-import: dist
-       rm -rf /tmp/${DISTPREFIX}
-       ${INSTALL} -d /tmp/${DISTPREFIX}
-       tar xvJpf ${DISTFILE} -C /tmp
+_import: dist
+       rm -rf ${DESTDIR}/*
+       ${INSTALL} -d ${DESTDIR}
+       tar xvpf ${DISTFILE} -C ${DESTDIR} --strip 1
+       @${ECHO}
+       @${ECHO} "============================================================="
+       @${ECHO} "dhcpcd-${VERSION} imported to ${DESTDIR}"
+
+import:
+       ${MAKE} _import DESTDIR=`if [ -n "${DESTDIR}" ]; then echo "${DESTDIR}"; else  echo /tmp/${DISTPREFIX}; fi`
+
+
+_import-src:
+       rm -rf ${DESTDIR}/*
+       ${INSTALL} -d ${DESTDIR}
+       cp LICENSE README.md ${DESTDIR};
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} DESTDIR=${DESTDIR} $@ || exit $$?; cd ..; done
+       @${ECHO}
+       @${ECHO} "============================================================="
+       @${ECHO} "dhcpcd-${VERSION} imported to ${DESTDIR}"
+
+import-src:
+       ${MAKE} _import-src DESTDIR=`if [ -n "${DESTDIR}" ]; then echo "${DESTDIR}"; else  echo /tmp/${DISTPREFIX}; fi`
 
 include Makefile.inc
diff -r d3102e6394a4 -r 19f312de1840 external/bsd/dhcpcd/dist/Makefile.inc
--- a/external/bsd/dhcpcd/dist/Makefile.inc     Thu Sep 05 08:47:02 2019 +0000
+++ b/external/bsd/dhcpcd/dist/Makefile.inc     Thu Sep 05 08:56:55 2019 +0000
@@ -8,6 +8,7 @@
 CONFMODE?=     0644
 
 CC?=           cc
+ECHO?=         echo
 INSTALL?=      install
 LINT?=         lint
 SED?=          sed
diff -r d3102e6394a4 -r 19f312de1840 external/bsd/dhcpcd/dist/compat/rb.c
--- a/external/bsd/dhcpcd/dist/compat/rb.c      Thu Sep 05 08:47:02 2019 +0000
+++ b/external/bsd/dhcpcd/dist/compat/rb.c      Thu Sep 05 08:56:55 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rb.c,v 1.1.1.1 2019/07/24 09:54:48 roy Exp $   */
+/*     $NetBSD: rb.c,v 1.1.1.1.2.1 2019/09/05 08:56:55 martin Exp $    */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -29,6 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "config.h"
 #include "common.h"
 
 #if !defined(_KERNEL) && !defined(_STANDALONE)
@@ -43,10 +44,10 @@
 #define KASSERT(s)     do { } while (/*CONSTCOND*/ 0)
 #define        __rbt_unused    __unused
 #endif
-__RCSID("$NetBSD: rb.c,v 1.1.1.1 2019/07/24 09:54:48 roy Exp $");
+__RCSID("$NetBSD: rb.c,v 1.1.1.1.2.1 2019/09/05 08:56:55 martin Exp $");
 #else
 #include <lib/libkern/libkern.h>
-__KERNEL_RCSID(0, "$NetBSD: rb.c,v 1.1.1.1 2019/07/24 09:54:48 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rb.c,v 1.1.1.1.2.1 2019/09/05 08:56:55 martin Exp $");
 #ifndef DIAGNOSTIC
 #define        __rbt_unused    __unused
 #else
diff -r d3102e6394a4 -r 19f312de1840 external/bsd/dhcpcd/dist/compat/rbtree.h
--- a/external/bsd/dhcpcd/dist/compat/rbtree.h  Thu Sep 05 08:47:02 2019 +0000
+++ b/external/bsd/dhcpcd/dist/compat/rbtree.h  Thu Sep 05 08:56:55 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rbtree.h,v 1.1.1.1 2019/07/24 09:54:48 roy Exp $       */
+/*     $NetBSD: rbtree.h,v 1.1.1.1.2.1 2019/09/05 08:56:55 martin Exp $        */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -32,6 +32,7 @@
 #ifndef _SYS_RBTREE_H_
 #define        _SYS_RBTREE_H_
 
+#include "config.h"
 #include "common.h"
 
 #if defined(_KERNEL) || defined(_STANDALONE)
@@ -40,7 +41,11 @@
 #include <stdbool.h>
 #include <inttypes.h>
 #endif
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#else
 #include "queue.h"
+#endif
 #if !defined(__linux__) && !defined(__QNX__) && !defined(__sun)
 #include <sys/endian.h>
 #else
diff -r d3102e6394a4 -r 19f312de1840 external/bsd/dhcpcd/dist/configure
--- a/external/bsd/dhcpcd/dist/configure        Thu Sep 05 08:47:02 2019 +0000
+++ b/external/bsd/dhcpcd/dist/configure        Thu Sep 05 08:56:55 2019 +0000
@@ -179,25 +179,6 @@
 : ${WC:=wc}
 
 : ${FORK:=yes}
-: ${SYSCONFDIR:=$PREFIX/etc}
-: ${SBINDIR:=$PREFIX/sbin}
-: ${LIBDIR:=$PREFIX/lib}
-: ${LIBEXECDIR:=$PREFIX/libexec}
-: ${STATEDIR:=/var}
-: ${DBDIR:=$STATEDIR/db/dhcpcd}
-: ${RUNDIR:=$STATEDIR/run}
-: ${MANDIR:=${PREFIX:-/usr}/share/man}
-: ${DATADIR:=${PREFIX:-/usr}/share}
-
-eval SYSCONFDIR="$SYSCONFDIR"
-eval LIBDIR="$LIBDIR"
-eval LIBEXECDIR="$LIBEXECDIR"
-eval STATEDIR="$STATEDIR"
-eval DBDIR="$DBDIR"
-eval RUNDIR="$RUNDIR"
-eval MANDIR="$MANDIR"
-eval DATADIR="$DATADIR"
-
 _which()
 {
        x="$(which "$1" 2>/dev/null)"
@@ -252,6 +233,10 @@
        esac
        # Special case
        case "$OS" in
+       dragonfly*)
+               # This means /usr HAS to be mounted not via dhcpcd
+               : ${LIBEXECDIR:=${PREFIX:-/usr}/libexec}
+               ;;
        gnu*) OS=hurd;; # No HURD support as yet
        esac
 fi
@@ -261,6 +246,26 @@
 echo "# $OS" >$CONFIG_MK
 echo "/* $OS */" >$CONFIG_H
 
+: ${SYSCONFDIR:=$PREFIX/etc}
+: ${SBINDIR:=$PREFIX/sbin}
+: ${LIBDIR:=$PREFIX/lib}
+: ${LIBEXECDIR:=$PREFIX/libexec}
+: ${STATEDIR:=/var}
+: ${DBDIR:=$STATEDIR/db/dhcpcd}
+: ${RUNDIR:=$STATEDIR/run}
+: ${MANDIR:=${PREFIX:-/usr}/share/man}
+: ${DATADIR:=${PREFIX:-/usr}/share}
+
+eval SYSCONFDIR="$SYSCONFDIR"
+eval LIBDIR="$LIBDIR"
+eval LIBEXECDIR="$LIBEXECDIR"
+eval STATEDIR="$STATEDIR"
+eval DBDIR="$DBDIR"
+eval RUNDIR="$RUNDIR"
+eval MANDIR="$MANDIR"
+eval DATADIR="$DATADIR"
+
+echo "#ifndef  SYSCONFDIR" >>$CONFIG_H
 for x in SYSCONFDIR SBINDIR LIBDIR LIBEXECDIR DBDIR RUNDIR; do
        eval v=\$$x
        # Make files look nice for import
@@ -272,6 +277,8 @@
        [ $l -gt 2 ] && t="     "
        echo "#define   $x$t            \"$v\"" >>$CONFIG_H
 done
+echo "#endif" >>$CONFIG_H
+
 echo "LIBDIR=          $LIBDIR" >>$CONFIG_MK
 echo "MANDIR=          $MANDIR" >>$CONFIG_MK
 echo "DATADIR= $DATADIR" >>$CONFIG_MK
@@ -452,8 +459,6 @@
        echo "DHCPCD_SRCS+=     if-bsd.c" >>$CONFIG_MK
        ;;
 sunos*)
-       echo "WARNING!!! Solaris support is at early development stage!" >&2
-       echo "so don't expect it to work just yet, patches welcome" >&2
        echo "CPPFLAGS+=        -D_XPG4_2 -D__EXTENSIONS__ -DBSD_COMP" \
            >>$CONFIG_MK
        echo "DHCPCD_SRCS+=     if-sun.c" >>$CONFIG_MK
@@ -497,10 +502,6 @@
        echo "Enabling Authentication"
        echo "CPPFLAGS+=        -DAUTH" >>$CONFIG_MK
        echo "SRCS+=            auth.c" >>$CONFIG_MK
-       echo "CRYPT_SRCS+=      \${HMAC_SRC}" >>$CONFIG_MK
-fi
-if [ -z "$INET6" -o "$INET6" = yes -o -z "$AUTH" -o "$AUTH" = yes ]; then
-       echo "CRYPT_SRCS+=      \${MD5_SRC} \${SHA256_SRC}" >>$CONFIG_MK
 fi
 
 echo "Using compiler .. $CC"
@@ -931,6 +932,30 @@
        echo "$TAILQ_FOREACH_SAFE"
        rm -f _queue.c _queue
 fi
+if [ "$TAILQ_FOREACH_SAFE" = no ] && [ -z "$TAILQ_FOREACH_MUTABLE" ]; then
+       printf "Testing for TAILQ_FOREACH_MUTABLE ... "
+       cat <<EOF >_queue.c
+#include <sys/queue.h>
+int main(void) {
+#ifndef TAILQ_FOREACH_MUTABLE
+#error TAILQ_FOREACH_MUTABLE
+#endif
+       return 0;
+}
+EOF
+       if $XCC _queue.c -o _queue 2>&3; then
+               TAILQ_FOREACH_MUTABLE=yes
+               TAILQ_FOREACH_SAFE=yes
+               TAILQ_FOREACH=yes
+               echo "#define   TAILQ_FOREACH_SAFE      TAILQ_FOREACH_MUTABLE" \
+                       >> $CONFIG_H
+       else
+               TAILQ_FOREACH_MUTABLE=no
+       fi
+       echo "$TAILQ_FOREACH_MUTABLE"
+       rm -f _queue.c _queue
+fi
+
 
 if [ -z "$TAILQ_CONCAT" ]; then
        printf "Testing for TAILQ_CONCAT ..."
@@ -1007,7 +1032,7 @@
        rm -f _rbtree.c _rbtree
 fi
 if [ "$RBTREE" = no ]; then
-       echo "CPPFLAGS+=        -DRBTEST" >>$CONFIG_MK
+       echo "#define   RBTEST" >>$CONFIG_H
        echo "COMPAT_SRCS+=     compat/rb.c" >>$CONFIG_MK
        echo "#include                  \"compat/rbtree.h\"" >>$CONFIG_H
 else
@@ -1186,6 +1211,14 @@
        echo "#define   HAVE_SYS_BITOPS_H" >>$CONFIG_H
 fi
 
+# Workaround for DragonFlyBSD import
+if [ "$OS" = dragonfly ]; then
+       echo "#ifdef    USE_PRIVATECRYPTO" >>$CONFIG_H
+       echo "#define   HAVE_MD5_H" >>$CONFIG_H
+       echo "#define   SHA2_H  <sha256.h>" >>$CONFIG_H
+       echo "#else" >>$CONFIG_H
+fi
+
 if [ -z "$MD5" ]; then
        MD5_LIB=
        printf "Testing for MD5Init ... "



Home | Main Index | Thread Index | Old Index