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-7.2.3 with the followin...



details:   https://anonhg.NetBSD.org/src/rev/096aaaf90fac
branches:  ROY
changeset: 455221:096aaaf90fac
user:      roy <roy%NetBSD.org@localhost>
date:      Wed Jun 26 17:46:09 2019 +0000

description:
Import dhcpcd-7.2.3 with the following changes:
  *  BSD: Check RTM lengths incase of kernel issues
  *  DHCP6: Don't stop even when last router goes away
  *  DHCP6: Fix inform from RA
  *  hostname: Fix short hostname check

diffstat:

 external/bsd/dhcpcd/dist/hooks/30-hostname |   2 +-
 external/bsd/dhcpcd/dist/src/defs.h        |   2 +-
 external/bsd/dhcpcd/dist/src/dhcp6.c       |  17 ++---------------
 external/bsd/dhcpcd/dist/src/dhcp6.h       |   1 -
 external/bsd/dhcpcd/dist/src/dhcpcd.c      |   3 +--
 external/bsd/dhcpcd/dist/src/if-bsd.c      |   9 ++++++---
 external/bsd/dhcpcd/dist/src/ipv6nd.c      |  16 ----------------
 7 files changed, 11 insertions(+), 39 deletions(-)

diffs (162 lines):

diff -r f04902d5c34c -r 096aaaf90fac external/bsd/dhcpcd/dist/hooks/30-hostname
--- a/external/bsd/dhcpcd/dist/hooks/30-hostname        Sat May 04 09:40:27 2019 +0000
+++ b/external/bsd/dhcpcd/dist/hooks/30-hostname        Wed Jun 26 17:46:09 2019 +0000
@@ -80,7 +80,7 @@
        set_hostname_vars
 
        if [ -n "$old_fqdn" ]; then
-               if ${hfqdn} || ! ${hsort}; then
+               if ${hfqdn} || ! ${hshort}; then
                        [ "$hostname" = "$old_fqdn" ]
                else
                        [ "$hostname" = "${old_fqdn%%.*}" ]
diff -r f04902d5c34c -r 096aaaf90fac external/bsd/dhcpcd/dist/src/defs.h
--- a/external/bsd/dhcpcd/dist/src/defs.h       Sat May 04 09:40:27 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/defs.h       Wed Jun 26 17:46:09 2019 +0000
@@ -28,7 +28,7 @@
 #define CONFIG_H
 
 #define PACKAGE                        "dhcpcd"
-#define VERSION                        "7.2.2"
+#define VERSION                        "7.2.3"
 
 #ifndef CONFIG
 # define CONFIG                        SYSCONFDIR "/" PACKAGE ".conf"
diff -r f04902d5c34c -r 096aaaf90fac external/bsd/dhcpcd/dist/src/dhcp6.c
--- a/external/bsd/dhcpcd/dist/src/dhcp6.c      Sat May 04 09:40:27 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcp6.c      Wed Jun 26 17:46:09 2019 +0000
@@ -3783,6 +3783,8 @@
                        /* No DHCPv6 config, no existing state
                         * so nothing to do. */
                        return 0;
+               case DH6S_INFORM:
+                       break;
                default:
                        init_state = DH6S_INIT;
                        break;
@@ -3935,21 +3937,6 @@
 }
 
 void
-dhcp6_dropnondelegates(struct interface *ifp)
-{
-
-#ifndef SMALL
-       if (dhcp6_hasprefixdelegation(ifp))
-               return;
-#endif
-       if (D6_CSTATE(ifp) == NULL)
-               return;
-
-       loginfox("%s: dropping DHCPv6 due to no valid routers", ifp->name);
-       dhcp6_drop(ifp, "EXPIRE6");
-}
-
-void
 dhcp6_abort(struct interface *ifp)
 {
        struct dhcp6_state *state;
diff -r f04902d5c34c -r 096aaaf90fac external/bsd/dhcpcd/dist/src/dhcp6.h
--- a/external/bsd/dhcpcd/dist/src/dhcp6.h      Sat May 04 09:40:27 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcp6.h      Wed Jun 26 17:46:09 2019 +0000
@@ -235,7 +235,6 @@
 int dhcp6_dadcompleted(const struct interface *);
 void dhcp6_abort(struct interface *);
 void dhcp6_drop(struct interface *, const char *);
-void dhcp6_dropnondelegates(struct interface *ifp);
 int dhcp6_dump(struct interface *);
 #endif /* DHCP6 */
 
diff -r f04902d5c34c -r 096aaaf90fac external/bsd/dhcpcd/dist/src/dhcpcd.c
--- a/external/bsd/dhcpcd/dist/src/dhcpcd.c     Sat May 04 09:40:27 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcpcd.c     Wed Jun 26 17:46:09 2019 +0000
@@ -1081,8 +1081,7 @@
                        dhcpcd_linkoverflow(ctx);
                        return;
                }
-               if (errno != ENOTSUP)
-                       logerr(__func__);
+               logerr(__func__);
        }
 }
 
diff -r f04902d5c34c -r 096aaaf90fac external/bsd/dhcpcd/dist/src/if-bsd.c
--- a/external/bsd/dhcpcd/dist/src/if-bsd.c     Sat May 04 09:40:27 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/if-bsd.c     Wed Jun 26 17:46:09 2019 +0000
@@ -1063,7 +1063,7 @@
                return 0;
 
        if (if_copyrt(ctx, &rt, rtm) == -1)
-               return -1;
+               return errno == ENOTSUP ? 0 : -1;
 
 #ifdef INET6
        /*
@@ -1305,7 +1305,8 @@
                return if_ifa(ctx, (const void *)rtm);
 #ifdef RTM_DESYNC
        case RTM_DESYNC:
-               return dhcpcd_linkoverflow(ctx);
+               dhcpcd_linkoverflow(ctx);
+               return 0;
 #endif
        }
 
@@ -1325,7 +1326,9 @@
                return -1;
        if (len == 0)
                return 0;
-       if (len < rtm.hdr.rtm_msglen) {
+       if ((size_t)len < offsetof(struct rt_msghdr, rtm_index) ||
+           len < rtm.hdr.rtm_msglen)
+       {
                errno = EINVAL;
                return -1;
        }
diff -r f04902d5c34c -r 096aaaf90fac external/bsd/dhcpcd/dist/src/ipv6nd.c
--- a/external/bsd/dhcpcd/dist/src/ipv6nd.c     Sat May 04 09:40:27 2019 +0000
+++ b/external/bsd/dhcpcd/dist/src/ipv6nd.c     Wed Jun 26 17:46:09 2019 +0000
@@ -382,9 +382,6 @@
        else {
                logwarnx("%s: no IPv6 Routers available", ifp->name);
                ipv6nd_drop(ifp);
-#ifdef DHCP6
-               dhcp6_dropnondelegates(ifp);
-#endif
        }
 }
 
@@ -1525,9 +1522,6 @@
        struct timespec now, lt, expire, next;
        bool expired, valid, validone;
        struct ipv6_addr *ia;
-#ifdef DHCP6
-       bool anyvalid = false;
-#endif
 
        ifp = arg;
        clock_gettime(CLOCK_MONOTONIC, &now);
@@ -1603,10 +1597,6 @@
                 * as well punt it. */
                if (!valid && !validone)
                        ipv6nd_free_ra(rap);
-#ifdef DHCP6
-               else
-                       anyvalid = true;
-#endif
        }
 
        if (timespecisset(&next))
@@ -1616,12 +1606,6 @@
                rt_build(ifp->ctx, AF_INET6);
                script_runreason(ifp, "ROUTERADVERT");
        }
-
-#ifdef DHCP6
-       /* No valid routers? Kill any DHCPv6. */
-       if (!anyvalid)
-               dhcp6_dropnondelegates(ifp);
-#endif
 }
 
 void



Home | Main Index | Thread Index | Old Index