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/src Import dhcpcd-8.0.1 with the fo...



details:   https://anonhg.NetBSD.org/src/rev/0a7ff5b2fab8
branches:  trunk
changeset: 962582:0a7ff5b2fab8
user:      roy <roy%NetBSD.org@localhost>
date:      Thu Jul 25 08:53:54 2019 +0000

description:
Import dhcpcd-8.0.1 with the following changes:

  *  Compile fixes for various build options on various platforms
  *  IPv4LL is fixed on NetBSD-8
  *  Script buffers are freed on forking

diffstat:

 external/bsd/dhcpcd/dist/src/defs.h   |   2 +-
 external/bsd/dhcpcd/dist/src/ipv4.c   |   6 ++++--
 external/bsd/dhcpcd/dist/src/ipv4ll.c |  13 +++++++++----
 external/bsd/dhcpcd/dist/src/script.c |   2 +-
 4 files changed, 15 insertions(+), 8 deletions(-)

diffs (96 lines):

diff -r ac7a864ef9be -r 0a7ff5b2fab8 external/bsd/dhcpcd/dist/src/defs.h
--- a/external/bsd/dhcpcd/dist/src/defs.h       Thu Jul 25 08:35:36 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/defs.h       Thu Jul 25 08:53:54 2019 +0000
@@ -29,7 +29,7 @@
 #define CONFIG_H
 
 #define PACKAGE                        "dhcpcd"
-#define VERSION                        "8.0.0"
+#define VERSION                        "8.0.1"
 
 #ifndef CONFIG
 # define CONFIG                        SYSCONFDIR "/" PACKAGE ".conf"
diff -r ac7a864ef9be -r 0a7ff5b2fab8 external/bsd/dhcpcd/dist/src/ipv4.c
--- a/external/bsd/dhcpcd/dist/src/ipv4.c       Thu Jul 25 08:35:36 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/ipv4.c       Thu Jul 25 08:53:54 2019 +0000
@@ -453,9 +453,7 @@
 inet_getroutes(struct dhcpcd_ctx *ctx, rb_tree_t *routes)
 {
        struct interface *ifp;
-#ifdef IPV4LL
        bool have_default = false;
-#endif
 
        TAILQ_FOREACH(ifp, ctx->ifaces, next) {
                if (!ifp->active)
@@ -504,6 +502,8 @@
 #ifdef ARP
        if (!keeparp)
                arp_freeaddr(addr->iface, &addr->addr);
+#else
+       UNUSED(keeparp);
 #endif
 
        state = IPV4_STATE(addr->iface);
@@ -541,7 +541,9 @@
            ifo->options & DHCPCD_INFORM ||
            (ifo->options & DHCPCD_STATIC && ifo->req_addr.s_addr == 0))
                return 0;
+#ifdef ARP
        arp_freeaddr(ifp, &state->addr->addr);
+#endif
        r = ipv4_deladdr(state->addr, 0);
        return r;
 }
diff -r ac7a864ef9be -r 0a7ff5b2fab8 external/bsd/dhcpcd/dist/src/ipv4ll.c
--- a/external/bsd/dhcpcd/dist/src/ipv4ll.c     Thu Jul 25 08:35:36 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/ipv4ll.c     Thu Jul 25 08:53:54 2019 +0000
@@ -298,7 +298,7 @@
        state = IPV4LL_STATE(ifp);
        assert(state != NULL);
        assert(state->arp == astate);
-       ipv4ll_not_found_arp(astate);
+       ipv4ll_not_found(ifp);
 }
 
 static void
@@ -552,19 +552,24 @@
 
        ifp = ia->iface;
        state = IPV4LL_STATE(ifp);
-       if (state == NULL || state->addr == NULL ||
-           !IN_ARE_ADDR_EQUAL(&state->addr->addr, &ia->addr))
+       if (state == NULL)
                return;
 
-       if (cmd == RTM_DELADDR) {
+       if (cmd == RTM_DELADDR &&
+           state->addr != NULL &&
+           IN_ARE_ADDR_EQUAL(&state->addr->addr, &ia->addr))
+       {
                loginfox("%s: pid %d deleted IP address %s",
                    ifp->name, pid, ia->saddr);
                ipv4ll_defend_failed(ifp);
+               return;
        }
 
 #ifdef IN_IFF_DUPLICATED
        if (cmd != RTM_NEWADDR)
                return;
+       if (!IN_ARE_ADDR_EQUAL(&state->pickedaddr, &ia->addr))
+               return;
        if (!(ia->addr_flags & IN_IFF_NOTUSEABLE))
                ipv4ll_not_found(ifp);
        else if (ia->addr_flags & IN_IFF_DUPLICATED) {
diff -r ac7a864ef9be -r 0a7ff5b2fab8 external/bsd/dhcpcd/dist/src/script.c
--- a/external/bsd/dhcpcd/dist/src/script.c     Thu Jul 25 08:35:36 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/script.c     Thu Jul 25 08:53:54 2019 +0000
@@ -180,7 +180,7 @@
        char **env, **envp, *buf, *bufp, *endp, *path;
        size_t nenv;
        long buf_pos, i;
-       int protocol;
+       int protocol = PROTO_LINK;
        const struct if_options *ifo = ifp->options;
        const struct interface *ifp2;
        int af;



Home | Main Index | Thread Index | Old Index