Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/dhcpcd/dist Import dhcpcd-7.0.3 with the follow...



details:   https://anonhg.NetBSD.org/src/rev/a9f3b08b0815
branches:  trunk
changeset: 360909:a9f3b08b0815
user:      roy <roy%NetBSD.org@localhost>
date:      Fri Apr 06 10:46:36 2018 +0000

description:
Import dhcpcd-7.0.3 with the following changes:

  *  dhcp6: fix a null termination overflow on status messages
  *  options: static routes can be setup in global context again
  *  routes: dhcpcd added host routes are now reported correctly

diffstat:

 external/bsd/dhcpcd/dist/configure        |  57 ++++++++++++++++--------------
 external/bsd/dhcpcd/dist/src/defs.h       |   2 +-
 external/bsd/dhcpcd/dist/src/dev/udev.c   |  23 +++++------
 external/bsd/dhcpcd/dist/src/dhcp6.c      |  11 +++--
 external/bsd/dhcpcd/dist/src/if-options.h |   2 +-
 external/bsd/dhcpcd/dist/src/if.c         |   2 +-
 external/bsd/dhcpcd/dist/src/ipv4.c       |   6 ++-
 external/bsd/dhcpcd/dist/src/route.c      |  44 ++++++++++++++++++-----
 external/bsd/dhcpcd/dist/src/route.h      |   3 +
 9 files changed, 91 insertions(+), 59 deletions(-)

diffs (truncated from 477 to 300 lines):

diff -r ad5153eb2213 -r a9f3b08b0815 external/bsd/dhcpcd/dist/configure
--- a/external/bsd/dhcpcd/dist/configure        Fri Apr 06 10:38:53 2018 +0000
+++ b/external/bsd/dhcpcd/dist/configure        Fri Apr 06 10:46:36 2018 +0000
@@ -266,7 +266,7 @@
        echo "$x=$t     $v" >>$CONFIG_MK
        unset t
        [ $l -gt 2 ] && t="     "
-       echo "#define $x$t      \"$v\"" >>$CONFIG_H
+       echo "#define   $x$t            \"$v\"" >>$CONFIG_H
 done
 echo "LIBDIR=          $LIBDIR" >>$CONFIG_MK
 echo "MANDIR=          $MANDIR" >>$CONFIG_MK
@@ -547,7 +547,7 @@
 EOF
        if $XCC _nl80211.c -o _nl80211 2>&3; then
                echo "yes"
-               echo "#define HAVE_NL80211_H" >>$CONFIG_H
+               echo "#define   HAVE_NL80211_H" >>$CONFIG_H
        else
                echo "no"
                echo "DHCPCD_SRCS+=     if-linux-wext.c" >>$CONFIG_MK
@@ -564,7 +564,7 @@
 EOF
        if $XCC _IN6_ADDR_GEN_MODE_NONE.c -o _IN6_ADDR_GEN_MODE_NONE 2>&3; then
                echo "yes"
-               echo "#define HAVE_IN6_ADDR_GEN_MODE_NONE" >>$CONFIG_H
+               echo "#define   HAVE_IN6_ADDR_GEN_MODE_NONE" >>$CONFIG_H
        else
                echo "no"
        fi
@@ -580,7 +580,7 @@
 EOF
        if $XCC _ifam_pid.c -o _ifam_pid 2>&3; then
                echo "yes"
-               echo "#define HAVE_IFAM_PID" >>$CONFIG_H
+               echo "#define   HAVE_IFAM_PID" >>$CONFIG_H
        else
                echo "no"
        fi
@@ -596,7 +596,7 @@
 EOF
        if $XCC _ifam_addrflags.c -o _ifam_addrflags 2>&3; then
                echo "yes"
-               echo "#define HAVE_IFAM_ADDRFLAGS" >>$CONFIG_H
+               echo "#define   HAVE_IFAM_ADDRFLAGS" >>$CONFIG_H
        else
                echo "no"
        fi
@@ -641,7 +641,7 @@
 EOF
 if $XCC _getifaddrs_addrflags.c -o _getifaddrs_addrflags $LIBSOCKET 2>&3; then
        echo "yes"
-       echo "#define HAVE_IFADDRS_ADDRFLAGS" >>$CONFIG_H
+       echo "#define   HAVE_IFADDRS_ADDRFLAGS" >>$CONFIG_H
 else
        echo "no"
 fi
@@ -793,7 +793,7 @@
        echo "COMPAT_SRCS+=     compat/pidfile.c" >>$CONFIG_MK
        echo "#include          \"compat/pidfile.h\"" >>$CONFIG_H
 else
-       echo "#define HAVE_UTIL_H" >>$CONFIG_H
+       echo "#define   HAVE_UTIL_H" >>$CONFIG_H
        if [ -n "$LIBUTIL" ]; then
                echo "LDADD+=           $LIBUTIL" >>$CONFIG_MK
        fi
@@ -939,7 +939,7 @@
        fi
        echo "#include          \"compat/queue.h\"">>$CONFIG_H
 else
-       echo "#define HAVE_SYS_QUEUE_H" >>$CONFIG_H
+       echo "#define   HAVE_SYS_QUEUE_H" >>$CONFIG_H
 fi
 
 if [ -z "$REALLOCARRAY" ]; then
@@ -965,7 +965,7 @@
        echo "#include          \"compat/reallocarray.h\"">>$CONFIG_H
 fi
 # Set this for eloop
-echo "#define HAVE_REALLOCARRAY" >>$CONFIG_H
+echo "#define  HAVE_REALLOCARRAY" >>$CONFIG_H
 
 if [ -z "$POLL" ]; then
        printf "Testing for kqueue1 ... "
@@ -1021,7 +1021,7 @@
 EOF
        if $XCC _epoll.c -o _epoll 2>&3; then
                POLL=epoll
-               echo "#define HAVE_EPOLL" >>$CONFIG_MK
+               echo "#define   HAVE_EPOLL" >>$CONFIG_MK
                echo "yes"
        else
                echo "no"
@@ -1048,23 +1048,23 @@
 fi
 case "$POLL" in
 kqueue1)
-       echo "#define HAVE_KQUEUE" >>$CONFIG_H
-       echo "#define HAVE_KQUEUE1" >>$CONFIG_H
+       echo "#define   HAVE_KQUEUE" >>$CONFIG_H
+       echo "#define   HAVE_KQUEUE1" >>$CONFIG_H
        ;;
 kqueue)
-       echo "#define HAVE_KQUEUE" >>$CONFIG_H
+       echo "#define   HAVE_KQUEUE" >>$CONFIG_H
        ;;
 epoll)
-       echo "#define HAVE_EPOLL" >>$CONFIG_H
+       echo "#define   HAVE_EPOLL" >>$CONFIG_H
        ;;
 pollts)
-       echo "#define HAVE_POLLTS" >>$CONFIG_H
+       echo "#define   HAVE_POLLTS" >>$CONFIG_H
        ;;
 ppoll)
-       echo "#define HAVE_PPOLL" >>$CONFIG_H
+       echo "#define   HAVE_PPOLL" >>$CONFIG_H
        ;;
 pselect)
-       echo "#define HAVE_PSELECT" >>$CONFIG_H
+       echo "#define   HAVE_PSELECT" >>$CONFIG_H
        ;;
 *)
        echo "No suitable polling function is available, not even pselect" >&2
@@ -1111,7 +1111,7 @@
        rm -f _fls64.c _fls64
 fi
 if [ "$FLS64" = yes ]; then
-       echo "#define HAVE_SYS_BITOPS_H" >>$CONFIG_H
+       echo "#define   HAVE_SYS_BITOPS_H" >>$CONFIG_H
 fi
 
 if [ -z "$MD5" ]; then
@@ -1149,7 +1149,7 @@
        echo "MD5_SRC=  compat/crypt/md5.c" >>$CONFIG_MK
 else
        echo "MD5_SRC=" >>$CONFIG_MK
-       echo "#define HAVE_MD5_H" >>$CONFIG_H
+       echo "#define   HAVE_MD5_H" >>$CONFIG_H
        [ -n "$MD5_LIB" ] && echo "LDADD+=              $MD5_LIB" >>$CONFIG_MK
 fi
 
@@ -1240,12 +1240,12 @@
        echo "SHA256_SRC=       compat/crypt/sha256.c" >>$CONFIG_MK
 else
        echo "SHA256_SRC=" >>$CONFIG_MK
-       echo "#define SHA2_H            <$SHA2_H>" >>$CONFIG_H
+       echo "#define   SHA2_H                  <$SHA2_H>" >>$CONFIG_H
        if [ "$SHA2_RENAMED" = yes ]; then
-               echo "#define SHA256_CTX        SHA2_CTX" >>$CONFIG_H
-               echo "#define SHA256_Init       SHA256Init" >>$CONFIG_H
-               echo "#define SHA256_Update     SHA256Update" >>$CONFIG_H
-               echo "#define SHA256_Final      SHA256Final" >>$CONFIG_H
+               echo "#define   SHA256_CTX      SHA2_CTX" >>$CONFIG_H
+               echo "#define   SHA256_Init     SHA256Init" >>$CONFIG_H
+               echo "#define   SHA256_Update   SHA256Update" >>$CONFIG_H
+               echo "#define   SHA256_Final    SHA256Final" >>$CONFIG_H
        fi
        [ -n "$SHA2_LIB" ] && echo "LDADD+=             $SHA2_LIB" >>$CONFIG_MK
 fi
@@ -1263,7 +1263,7 @@
 EOF
        if $XCC _hmac.c $MD5_LIB -o _hmac 2>&3; then
                HMAC=yes
-               echo "#define HAVE_HMAC_H" >>$CONFIG_H
+               echo "#define   HAVE_HMAC_H" >>$CONFIG_H
        else
                # Remove this test if NetBSD-8 ships with
                # hmac in it's own header and not stdlib.h
@@ -1285,9 +1285,9 @@
 fi
 if [ "$HMAC" = no ]; then
        echo "#include          \"compat/crypt/hmac.h\"" >>$CONFIG_H
-       echo "HMAC_SRC=         compat/crypt/hmac.c" >>$CONFIG_MK
+       echo "HMAC_SRC= compat/crypt/hmac.c" >>$CONFIG_MK
 else
-       # echo "#define HAVE_HMAC_H" >>$CONFIG_H
+       # echo "#define HAVE_HMAC_H" >>$CONFIG_H
        echo "HMAC_SRC=" >>$CONFIG_MK
 fi
 
@@ -1351,6 +1351,9 @@
        echo "CPPFLAGS+=        -DPLUGIN_DEV" >>$CONFIG_MK
        echo "MKDIRS+=  dev" >>$CONFIG_MK
 
+       # So the plugins have access to logerr
+       echo "LDFLAGS+= -Wl,-export-dynamic" >>$CONFIG_MK
+
        printf "Testing for dlopen ... "
        cat <<EOF >_dlopen.c
 #include <dlfcn.h>
diff -r ad5153eb2213 -r a9f3b08b0815 external/bsd/dhcpcd/dist/src/defs.h
--- a/external/bsd/dhcpcd/dist/src/defs.h       Fri Apr 06 10:38:53 2018 +0000
+++ b/external/bsd/dhcpcd/dist/src/defs.h       Fri Apr 06 10:46:36 2018 +0000
@@ -28,7 +28,7 @@
 #define CONFIG_H
 
 #define PACKAGE                        "dhcpcd"
-#define VERSION                        "7.0.2"
+#define VERSION                        "7.0.3"
 
 #ifndef CONFIG
 # define CONFIG                        SYSCONFDIR "/" PACKAGE ".conf"
diff -r ad5153eb2213 -r a9f3b08b0815 external/bsd/dhcpcd/dist/src/dev/udev.c
--- a/external/bsd/dhcpcd/dist/src/dev/udev.c   Fri Apr 06 10:38:53 2018 +0000
+++ b/external/bsd/dhcpcd/dist/src/dev/udev.c   Fri Apr 06 10:46:36 2018 +0000
@@ -1,6 +1,6 @@
 /*
  * dhcpcd - DHCP client daemon
- * Copyright (c) 2006-2015 Roy Marples <roy%marples.name@localhost>
+ * Copyright (c) 2006-2018 Roy Marples <roy%marples.name@localhost>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -35,10 +35,10 @@
 
 #include <libudev.h>
 #include <string.h>
-#include <syslog.h>
 
 #include "../common.h"
 #include "../dev.h"
+#include "../logerr.h"
 
 static const char udev_name[] = "udev";
 static struct udev *udev;
@@ -80,7 +80,7 @@
 
        device = udev_monitor_receive_device(monitor);
        if (device == NULL) {
-               syslog(LOG_ERR, "libudev: received NULL device");
+               logerrx("libudev: received NULL device");
                return -1;
        }
 
@@ -90,7 +90,7 @@
 
        /* udev filter documentation says "usually" so double check */
        if (strcmp(subsystem, "net") == 0) {
-               syslog(LOG_DEBUG, "%s: libudev: %s", ifname, action);
+               logdebugx("%s: libudev: %s", ifname, action);
                if (strcmp(action, "add") == 0 || strcmp(action, "move") == 0)
                        dhcpcd.handle_interface(ctx, 1, ifname);
                else if (strcmp(action, "remove") == 0)
@@ -122,37 +122,36 @@
        int fd;
 
        if (udev) {
-               syslog(LOG_ERR, "udev: already started");
+               logerrx("udev: already started");
                return -1;
        }
 
-       syslog(LOG_DEBUG, "udev: starting");
+       logdebugx("udev: starting");
        udev = udev_new();
        if (udev == NULL) {
-               syslog(LOG_ERR, "udev_new: %m");
+               logerr("udev_new");
                return -1;
        }
        monitor = udev_monitor_new_from_netlink(udev, "udev");
        if (monitor == NULL) {
-               syslog(LOG_ERR, "udev_monitor_new_from_netlink: %m");
+               logerr("udev_monitor_new_from_netlink");
                goto bad;
        }
 #ifndef LIBUDEV_NOFILTER
        if (udev_monitor_filter_add_match_subsystem_devtype(monitor,
            "net", NULL) != 0)
        {
-               syslog(LOG_ERR,
-                   "udev_monitor_filter_add_match_subsystem_devtype: %m");
+               logerr("udev_monitor_filter_add_match_subsystem_devtype");
                goto bad;
        }
 #endif
        if (udev_monitor_enable_receiving(monitor) != 0) {
-               syslog(LOG_ERR, "udev_monitor_enable_receiving: %m");
+               logerr("udev_monitor_enable_receiving");
                goto bad;
        }
        fd = udev_monitor_get_fd(monitor);
        if (fd == -1) {
-               syslog(LOG_ERR, "udev_monitor_get_fd: %m");
+               logerr("udev_monitor_get_fd");
                goto bad;
        }
        return fd;
diff -r ad5153eb2213 -r a9f3b08b0815 external/bsd/dhcpcd/dist/src/dhcp6.c
--- a/external/bsd/dhcpcd/dist/src/dhcp6.c      Fri Apr 06 10:38:53 2018 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcp6.c      Fri Apr 06 10:46:36 2018 +0000
@@ -1847,6 +1847,7 @@
 {
        uint8_t *opt;
        uint16_t opt_len, code;
+       size_t mlen;
        void * (*f)(void *, size_t, uint16_t, uint16_t *), *farg;
        char buf[32], *sbuf;
        const char *status;



Home | Main Index | Thread Index | Old Index