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.2.0 with the follow...



details:   https://anonhg.NetBSD.org/src/rev/3eb9513da696
branches:  trunk
changeset: 840794:3eb9513da696
user:      roy <roy%NetBSD.org@localhost>
date:      Wed Apr 17 23:33:08 2019 +0000

description:
Import dhcpcd-7.2.0 with the following changes:
  *  BSD: PF_LINK sockets now closed when no longer needed
  *  BSD: Fix detecting interface for scoped routes
  *  script: Allow "" to mean /dev/null
  *  script: Add static routers and routes to env
  *  DHCP: outbound interface is no longer dictated with IP_PKTINFO
  *  DHCP: BPF sockets now closed when no longer needed
  *  DHCPv6: Allow nooption dhcp6_unicast to work
  *  DHCPv6: Don't spam syslog if we always get the same error
  *  route: Log pid which deleted routes of interest

This release fixes PR bin/53705.

diffstat:

 external/bsd/dhcpcd/dist/BUILDING.md     |    3 -
 external/bsd/dhcpcd/dist/Makefile        |   12 +-
 external/bsd/dhcpcd/dist/configure       |    2 +-
 external/bsd/dhcpcd/dist/iconfig.mk      |    3 +-
 external/bsd/dhcpcd/dist/src/Makefile    |    6 +-
 external/bsd/dhcpcd/dist/src/arp.c       |   15 +-
 external/bsd/dhcpcd/dist/src/arp.h       |    1 -
 external/bsd/dhcpcd/dist/src/common.c    |   48 ---
 external/bsd/dhcpcd/dist/src/common.h    |    2 -
 external/bsd/dhcpcd/dist/src/defs.h      |    2 +-
 external/bsd/dhcpcd/dist/src/dhcp.h      |    1 +
 external/bsd/dhcpcd/dist/src/dhcp6.h     |    2 +-
 external/bsd/dhcpcd/dist/src/dhcpcd.8.in |    2 +-
 external/bsd/dhcpcd/dist/src/dhcpcd.h    |   13 -
 external/bsd/dhcpcd/dist/src/duid.c      |    1 +
 external/bsd/dhcpcd/dist/src/if-linux.c  |   80 ++--
 external/bsd/dhcpcd/dist/src/if-sun.c    |  490 ++++++++++++++++++++----------
 external/bsd/dhcpcd/dist/src/if.c        |  125 ++++++-
 external/bsd/dhcpcd/dist/src/if.h        |    9 +
 external/bsd/dhcpcd/dist/src/ipv4.c      |   10 +-
 external/bsd/dhcpcd/dist/src/ipv4ll.c    |    2 +
 external/bsd/dhcpcd/dist/src/ipv6.c      |   47 +-
 external/bsd/dhcpcd/dist/src/route.c     |    9 +-
 external/bsd/dhcpcd/dist/src/route.h     |    2 +-
 external/bsd/dhcpcd/dist/src/script.c    |   10 +-
 external/bsd/dhcpcd/dist/tests/Makefile  |    6 +-
 26 files changed, 547 insertions(+), 356 deletions(-)

diffs (truncated from 1636 to 300 lines):

diff -r e3c26e6bbf2b -r 3eb9513da696 external/bsd/dhcpcd/dist/BUILDING.md
--- a/external/bsd/dhcpcd/dist/BUILDING.md      Wed Apr 17 22:38:14 2019 +0000
+++ b/external/bsd/dhcpcd/dist/BUILDING.md      Wed Apr 17 23:33:08 2019 +0000
@@ -3,9 +3,6 @@
 This attempts to document various ways of building dhcpcd for your
 platform.
 
-Building for distribution (ie making a dhcpcd source tarball) now requires
-gmake-4 or any BSD make.
-
 ## Size is an issue
 To compile small dhcpcd, maybe to be used for installation media where
 size is a concern, you can use the `--small` configure option to enable
diff -r e3c26e6bbf2b -r 3eb9513da696 external/bsd/dhcpcd/dist/Makefile
--- a/external/bsd/dhcpcd/dist/Makefile Wed Apr 17 22:38:14 2019 +0000
+++ b/external/bsd/dhcpcd/dist/Makefile Wed Apr 17 23:33:08 2019 +0000
@@ -22,10 +22,10 @@
 .SUFFIXES:     .in
 
 all: config.h
-       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
 
 depend: config.h
-       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
 
 tests:
        cd $@; ${MAKE} $@
@@ -36,17 +36,17 @@
        cd $@; ${MAKE}
 
 eginstall:
-       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
 
 install:
-       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
 
 proginstall:
-       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
 
 clean:
        rm -rf cov-int dhcpcd.xz
-       for x in ${SUBDIRS} tests; do cd $$x; ${MAKE} $@; cd ..; done
+       for x in ${SUBDIRS} tests; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
 
 distclean: clean
        rm -f config.h config.mk config.log \
diff -r e3c26e6bbf2b -r 3eb9513da696 external/bsd/dhcpcd/dist/configure
--- a/external/bsd/dhcpcd/dist/configure        Wed Apr 17 22:38:14 2019 +0000
+++ b/external/bsd/dhcpcd/dist/configure        Wed Apr 17 23:33:08 2019 +0000
@@ -454,7 +454,7 @@
        echo "CPPFLAGS+=        -D_XPG4_2 -D__EXTENSIONS__ -DBSD_COMP" \
            >>$CONFIG_MK
        echo "DHCPCD_SRCS+=     if-sun.c" >>$CONFIG_MK
-       echo "LDADD+=           -ldlpi" >>$CONFIG_MK
+       echo "LDADD+=           -ldlpi -lkstat" >>$CONFIG_MK
        ;;
 *)
        echo "DHCPCD_SRCS+=     if-bsd.c" >>$CONFIG_MK
diff -r e3c26e6bbf2b -r 3eb9513da696 external/bsd/dhcpcd/dist/iconfig.mk
--- a/external/bsd/dhcpcd/dist/iconfig.mk       Wed Apr 17 22:38:14 2019 +0000
+++ b/external/bsd/dhcpcd/dist/iconfig.mk       Wed Apr 17 23:33:08 2019 +0000
@@ -1,7 +1,8 @@
 # Nasty hack so that make clean works without configure being run
-# Requires gmake4
 TOP?=          .
 _CONFIG_MK!=   test -e ${TOP}/config.mk && \
                    echo config.mk || echo config-null.mk
+_CONFIG_MK?=   $(shell test -e ${TOP}/config.mk && \
+                   echo config.mk || echo config-null.mk)
 CONFIG_MK?=    ${_CONFIG_MK}
 include                ${TOP}/${CONFIG_MK}
diff -r e3c26e6bbf2b -r 3eb9513da696 external/bsd/dhcpcd/dist/src/Makefile
--- a/external/bsd/dhcpcd/dist/src/Makefile     Wed Apr 17 22:38:14 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/Makefile     Wed Apr 17 23:33:08 2019 +0000
@@ -45,7 +45,7 @@
                $< > $@
 
 all: ${TOP}/config.h ${PROG} ${SCRIPTS} ${MAN5} ${MAN8}
-       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
 
 dev:
        cd dev && ${MAKE}
@@ -84,7 +84,7 @@
        ${INSTALL} -d ${DESTDIR}${DBDIR}
 
 proginstall: _proginstall ${EMBEDDEDINSTALL}
-       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
 
 _maninstall: ${MAN5} ${MAN8}
        ${INSTALL} -d ${DESTDIR}${MANDIR}/man5
@@ -130,7 +130,7 @@
 
 clean:
        rm -f ${OBJS} ${PROG} ${PROG}.core ${CLEANFILES}
-       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@; cd ..; done
+       for x in ${SUBDIRS}; do cd $$x; ${MAKE} $@ || exit $$?; cd ..; done
 
 distclean: clean
        rm -f .depend
diff -r e3c26e6bbf2b -r 3eb9513da696 external/bsd/dhcpcd/dist/src/arp.c
--- a/external/bsd/dhcpcd/dist/src/arp.c        Wed Apr 17 22:38:14 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/arp.c        Wed Apr 17 23:33:08 2019 +0000
@@ -175,17 +175,18 @@
        }
 }
 
-void
+static void
 arp_close(struct interface *ifp)
 {
        struct iarp_state *state;
 
-       if ((state = ARP_STATE(ifp)) != NULL && state->bpf_fd != -1) {
-               eloop_event_delete(ifp->ctx->eloop, state->bpf_fd);
-               bpf_close(ifp, state->bpf_fd);
-               state->bpf_fd = -1;
-               state->bpf_flags |= BPF_EOF;
-       }
+       if ((state = ARP_STATE(ifp)) == NULL || state->bpf_fd == -1)
+               return;
+
+       eloop_event_delete(ifp->ctx->eloop, state->bpf_fd);
+       bpf_close(ifp, state->bpf_fd);
+       state->bpf_fd = -1;
+       state->bpf_flags |= BPF_EOF;
 }
 
 static void
diff -r e3c26e6bbf2b -r 3eb9513da696 external/bsd/dhcpcd/dist/src/arp.h
--- a/external/bsd/dhcpcd/dist/src/arp.h        Wed Apr 17 22:38:14 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/arp.h        Wed Apr 17 23:33:08 2019 +0000
@@ -90,7 +90,6 @@
 int arp_open(struct interface *);
 ssize_t arp_request(const struct interface *, in_addr_t, in_addr_t);
 void arp_probe(struct arp_state *);
-void arp_close(struct interface *);
 void arp_report_conflicted(const struct arp_state *, const struct arp_msg *);
 struct arp_state *arp_new(struct interface *, const struct in_addr *);
 struct arp_state *arp_find(struct interface *, const struct in_addr *);
diff -r e3c26e6bbf2b -r 3eb9513da696 external/bsd/dhcpcd/dist/src/common.c
--- a/external/bsd/dhcpcd/dist/src/common.c     Wed Apr 17 22:38:14 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/common.c     Wed Apr 17 23:33:08 2019 +0000
@@ -200,51 +200,3 @@
        fclose(fp);
        return len;
 }
-
-ssize_t
-recvmsg_realloc(int fd, struct msghdr *msg, int flags)
-{
-       struct iovec *iov;
-       ssize_t slen;
-       size_t len;
-       void *n;
-
-       assert(msg != NULL);
-       assert(msg->msg_iov != NULL && msg->msg_iovlen > 0);
-       assert((flags & (MSG_PEEK | MSG_TRUNC)) == 0);
-
-       /* Assume we are reallocing the last iovec. */
-       iov = &msg->msg_iov[msg->msg_iovlen - 1];
-
-       for (;;) {
-               /* Passing MSG_TRUNC should return the actual size needed. */
-               slen = recvmsg(fd, msg, flags | MSG_PEEK | MSG_TRUNC);
-               if (slen == -1)
-                       return -1;
-               if (!(msg->msg_flags & MSG_TRUNC))
-                       break;
-
-               len = (size_t)slen;
-
-               /* Some kernels return the size of the receive buffer
-                * on truncation, not the actual size needed.
-                * So grow the buffer and try again. */
-               if (iov->iov_len == len)
-                       len++;
-               else if (iov->iov_len > len)
-                       break;
-               len = roundup(len, IOVEC_BUFSIZ);
-               if ((n = realloc(iov->iov_base, len)) == NULL)
-                       return -1;
-               iov->iov_base = n;
-               iov->iov_len = len;
-       }
-
-       slen = recvmsg(fd, msg, flags);
-       if (slen != -1 && msg->msg_flags & MSG_TRUNC) {
-               /* This should not be possible ... */
-               errno = ENOBUFS;
-               return -1;
-       }
-       return slen;
-}
diff -r e3c26e6bbf2b -r 3eb9513da696 external/bsd/dhcpcd/dist/src/common.h
--- a/external/bsd/dhcpcd/dist/src/common.h     Wed Apr 17 22:38:14 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/common.h     Wed Apr 17 23:33:08 2019 +0000
@@ -181,6 +181,4 @@
 const char *hwaddr_ntoa(const void *, size_t, char *, size_t);
 size_t hwaddr_aton(uint8_t *, const char *);
 size_t read_hwaddr_aton(uint8_t **, const char *);
-
-ssize_t recvmsg_realloc(int, struct msghdr *, int);
 #endif
diff -r e3c26e6bbf2b -r 3eb9513da696 external/bsd/dhcpcd/dist/src/defs.h
--- a/external/bsd/dhcpcd/dist/src/defs.h       Wed Apr 17 22:38:14 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/defs.h       Wed Apr 17 23:33:08 2019 +0000
@@ -28,7 +28,7 @@
 #define CONFIG_H
 
 #define PACKAGE                        "dhcpcd"
-#define VERSION                        "7.1.1"
+#define VERSION                        "7.2.0"
 
 #ifndef CONFIG
 # define CONFIG                        SYSCONFDIR "/" PACKAGE ".conf"
diff -r e3c26e6bbf2b -r 3eb9513da696 external/bsd/dhcpcd/dist/src/dhcp.h
--- a/external/bsd/dhcpcd/dist/src/dhcp.h       Wed Apr 17 22:38:14 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcp.h       Wed Apr 17 23:33:08 2019 +0000
@@ -216,6 +216,7 @@
 
        int bpf_fd;
        unsigned int bpf_flags;
+       int udp_fd;
        struct ipv4_addr *addr;
        uint8_t added;
 
diff -r e3c26e6bbf2b -r 3eb9513da696 external/bsd/dhcpcd/dist/src/dhcp6.h
--- a/external/bsd/dhcpcd/dist/src/dhcp6.h      Wed Apr 17 22:38:14 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcp6.h      Wed Apr 17 23:33:08 2019 +0000
@@ -206,7 +206,7 @@
        /* The +3 is for the possible .pd extension for prefix delegation */
        char leasefile[sizeof(LEASEFILE6) + IF_NAMESIZE + (IF_SSIDLEN * 4) +3];
        const char *reason;
-
+       uint16_t lerror; /* Last error received from DHCPv6 reply. */
        struct authstate auth;
 };
 
diff -r e3c26e6bbf2b -r 3eb9513da696 external/bsd/dhcpcd/dist/src/dhcpcd.8.in
--- a/external/bsd/dhcpcd/dist/src/dhcpcd.8.in  Wed Apr 17 22:38:14 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcpcd.8.in  Wed Apr 17 23:33:08 2019 +0000
@@ -584,7 +584,7 @@
 .Nm
 will try to do as much as it can by default.
 However, there are sometimes situations where you don't want the things to be
-configured exactly how the the DHCP server wants.
+configured exactly how the DHCP server wants.
 Here are some options that deal with turning these bits off.
 .Pp
 Note that when
diff -r e3c26e6bbf2b -r 3eb9513da696 external/bsd/dhcpcd/dist/src/dhcpcd.h
--- a/external/bsd/dhcpcd/dist/src/dhcpcd.h     Wed Apr 17 22:38:14 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcpcd.h     Wed Apr 17 23:33:08 2019 +0000
@@ -142,14 +142,10 @@
        struct rt_head froutes; /* free routes for re-use */
 
        int pf_inet_fd;
-#ifdef IFLR_ACTIVE
-       int pf_link_fd;
-#endif
        void *priv;
        int link_fd;
        int seq;        /* route message sequence no */
        int sseq;       /* successful seq no sent */
-       struct iovec iov[1];    /* generic iovec buffer */
 
 #ifdef USE_SIGNALS
        sigset_t sigset;
@@ -184,15 +180,6 @@
        uint8_t *secret;
        size_t secret_len;
 
-       unsigned char ctlbuf[IP6BUFLEN];
-       struct sockaddr_in6 from;
-       struct msghdr sndhdr;
-       struct iovec sndiov[1];
-       unsigned char sndbuf[CMSG_SPACE(sizeof(struct in6_pktinfo))];
-       struct msghdr rcvhdr;
-       char ntopbuf[INET6_ADDRSTRLEN];
-       const char *sfrom;
-
        int nd_fd;
        struct ra_head *ra_routers;
 
diff -r e3c26e6bbf2b -r 3eb9513da696 external/bsd/dhcpcd/dist/src/duid.c
--- a/external/bsd/dhcpcd/dist/src/duid.c       Wed Apr 17 22:38:14 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/duid.c       Wed Apr 17 23:33:08 2019 +0000
@@ -90,6 +90,7 @@
        fclose(fp);
        r = len == 1 ? -1 : 0;
 #else
+       UNUSED(uuid);



Home | Main Index | Thread Index | Old Index