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 Import dhcpcd-8.0.4 with the followin...



details:   https://anonhg.NetBSD.org/src/rev/ac7d78e1eedc
branches:  roy
changeset: 454085:ac7d78e1eedc
user:      roy <roy%NetBSD.org@localhost>
date:      Wed Sep 04 13:27:50 2019 +0000

description:
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

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/control.c        |    3 +
 external/bsd/dhcpcd/dist/src/defs.h           |    2 +-
 external/bsd/dhcpcd/dist/src/dhcp-common.c    |    2 +
 external/bsd/dhcpcd/dist/src/dhcp.c           |   39 +-
 external/bsd/dhcpcd/dist/src/dhcp6.c          |   40 +-
 external/bsd/dhcpcd/dist/src/dhcpcd.8.in      |   25 +-
 external/bsd/dhcpcd/dist/src/dhcpcd.c         |    7 +-
 external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in |    8 +-
 external/bsd/dhcpcd/dist/src/if-bsd.c         |   60 +++-
 external/bsd/dhcpcd/dist/src/if-linux.c       |   17 +-
 external/bsd/dhcpcd/dist/src/if-options.h     |    2 +-
 external/bsd/dhcpcd/dist/src/if-sun.c         |  323 ++++++++++++++-----------
 external/bsd/dhcpcd/dist/src/if.c             |    7 +
 external/bsd/dhcpcd/dist/src/if.h             |    1 +
 external/bsd/dhcpcd/dist/src/ipv4.h           |    3 +-
 external/bsd/dhcpcd/dist/src/ipv6.c           |   76 +++++-
 external/bsd/dhcpcd/dist/src/ipv6.h           |    7 +-
 external/bsd/dhcpcd/dist/src/ipv6nd.c         |  219 ++++++----------
 external/bsd/dhcpcd/dist/src/ipv6nd.h         |   15 +-
 external/bsd/dhcpcd/dist/src/route.c          |    2 +
 external/bsd/dhcpcd/dist/src/route.h          |    1 +
 29 files changed, 627 insertions(+), 437 deletions(-)

diffs (truncated from 2216 to 300 lines):

diff -r d48dee00b6ff -r ac7d78e1eedc external/bsd/dhcpcd/dist/BUILDING.md
--- a/external/bsd/dhcpcd/dist/BUILDING.md      Wed Aug 21 17:10:29 2019 +0000
+++ b/external/bsd/dhcpcd/dist/BUILDING.md      Wed Sep 04 13:27:50 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 d48dee00b6ff -r ac7d78e1eedc external/bsd/dhcpcd/dist/Makefile
--- a/external/bsd/dhcpcd/dist/Makefile Wed Aug 21 17:10:29 2019 +0000
+++ b/external/bsd/dhcpcd/dist/Makefile Wed Sep 04 13:27:50 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 d48dee00b6ff -r ac7d78e1eedc external/bsd/dhcpcd/dist/Makefile.inc
--- a/external/bsd/dhcpcd/dist/Makefile.inc     Wed Aug 21 17:10:29 2019 +0000
+++ b/external/bsd/dhcpcd/dist/Makefile.inc     Wed Sep 04 13:27:50 2019 +0000
@@ -8,6 +8,7 @@
 CONFMODE?=     0644
 
 CC?=           cc
+ECHO?=         echo
 INSTALL?=      install
 LINT?=         lint
 SED?=          sed
diff -r d48dee00b6ff -r ac7d78e1eedc external/bsd/dhcpcd/dist/compat/rb.c
--- a/external/bsd/dhcpcd/dist/compat/rb.c      Wed Aug 21 17:10:29 2019 +0000
+++ b/external/bsd/dhcpcd/dist/compat/rb.c      Wed Sep 04 13:27:50 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.2 2019/09/04 13:27:50 roy 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.2 2019/09/04 13:27:50 roy 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.2 2019/09/04 13:27:50 roy Exp $");
 #ifndef DIAGNOSTIC
 #define        __rbt_unused    __unused
 #else
diff -r d48dee00b6ff -r ac7d78e1eedc external/bsd/dhcpcd/dist/compat/rbtree.h
--- a/external/bsd/dhcpcd/dist/compat/rbtree.h  Wed Aug 21 17:10:29 2019 +0000
+++ b/external/bsd/dhcpcd/dist/compat/rbtree.h  Wed Sep 04 13:27:50 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.2 2019/09/04 13:27:50 roy 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 d48dee00b6ff -r ac7d78e1eedc external/bsd/dhcpcd/dist/configure
--- a/external/bsd/dhcpcd/dist/configure        Wed Aug 21 17:10:29 2019 +0000
+++ b/external/bsd/dhcpcd/dist/configure        Wed Sep 04 13:27:50 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