Source-Changes-HG archive

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

[src/netbsd-9]: src Apply patch, requested by roy in ticket #844:



details:   https://anonhg.NetBSD.org/src/rev/3b6cfba6d818
branches:  netbsd-9
changeset: 1001670:3b6cfba6d818
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Apr 23 12:06:09 2020 +0000

description:
Apply patch, requested by roy in ticket #844:

        external/bsd/dhcpcd/dist/src/defs.h            (apply patch)
        external/bsd/dhcpcd/dist/src/dhcp.c            (apply patch)
        external/bsd/dhcpcd/dist/src/dhcp6.c           (apply patch)
        external/bsd/dhcpcd/dist/src/ipv6nd.c          (apply patch)
        doc/3RDPARTY                                   (apply patch)

Update to dhcpcd-8.1.9 which fixes alignment issues.

diffstat:

 doc/3RDPARTY                          |   8 ++++----
 external/bsd/dhcpcd/dist/src/defs.h   |   2 +-
 external/bsd/dhcpcd/dist/src/dhcp.c   |  25 ++++++++++++++++---------
 external/bsd/dhcpcd/dist/src/dhcp6.c  |   7 +++++--
 external/bsd/dhcpcd/dist/src/ipv6nd.c |   8 ++++++--
 5 files changed, 32 insertions(+), 18 deletions(-)

diffs (134 lines):

diff -r cb9d517b9720 -r 3b6cfba6d818 doc/3RDPARTY
--- a/doc/3RDPARTY      Wed Apr 22 18:26:06 2020 +0000
+++ b/doc/3RDPARTY      Thu Apr 23 12:06:09 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: 3RDPARTY,v 1.1640.2.14 2020/04/12 17:33:24 martin Exp $
+#      $NetBSD: 3RDPARTY,v 1.1640.2.15 2020/04/23 12:06:09 martin Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -341,12 +341,12 @@
 Use the dhcp2netbsd script.
 
 Package:       dhcpcd
-Version:       8.1.8
-Current Vers:  8.1.8
+Version:       8.1.9
+Current Vers:  8.1.9
 Maintainer:    roy
 Archive Site:  ftp://roy.marples.name/pub/dhcpcd/
 Home Page:     http://roy.marples.name/projects/dhcpcd/
-Date:          2020-04-12
+Date:          2020-04-21
 Mailing List:  dhcpcd-discuss%marples.name@localhost
 License:       BSD (2-clause)
 Location:      external/bsd/dhcpcd/dist
diff -r cb9d517b9720 -r 3b6cfba6d818 external/bsd/dhcpcd/dist/src/defs.h
--- a/external/bsd/dhcpcd/dist/src/defs.h       Wed Apr 22 18:26:06 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/defs.h       Thu Apr 23 12:06:09 2020 +0000
@@ -29,7 +29,7 @@
 #define CONFIG_H
 
 #define PACKAGE                        "dhcpcd"
-#define VERSION                        "8.1.8"
+#define VERSION                        "8.1.9"
 
 #ifndef CONFIG
 # define CONFIG                        SYSCONFDIR "/" PACKAGE ".conf"
diff -r cb9d517b9720 -r 3b6cfba6d818 external/bsd/dhcpcd/dist/src/dhcp.c
--- a/external/bsd/dhcpcd/dist/src/dhcp.c       Wed Apr 22 18:26:06 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcp.c       Thu Apr 23 12:06:09 2020 +0000
@@ -3308,7 +3308,7 @@
        memcpy(&udp, (char *)ip + ip_hlen, sizeof(udp));
        if (ntohs(udp.uh_ulen) < sizeof(udp))
                return false;
-       if (ip_hlen + (size_t)ntohs(udp.uh_ulen) > plen)
+       if (ip_hlen + ntohs(udp.uh_ulen) > plen)
                return false;
 
        /* Check it's to and from the right ports. */
@@ -3453,12 +3453,16 @@
                        }
                        break;
                }
-               if (bytes < fl) {
-                       logerrx("%s: %s: short frame header",
-                           __func__, ifp->name);
-                       break;
+               if (fl != 0) {
+                       if (bytes < fl) {
+                               logerrx("%s: %s: short frame header",
+                                   __func__, ifp->name);
+                               break;
+                       }
+                       bytes -= fl;
+                       memmove(buf, buf + fl, (size_t)bytes);
                }
-               dhcp_packet(ifp, buf + fl, (size_t)(bytes - fl));
+               dhcp_packet(ifp, buf, (size_t)bytes);
                /* Check we still have a state after processing. */
                if ((state = D_STATE(ifp)) == NULL)
                        break;
@@ -3506,15 +3510,18 @@
                .iov_base = buf,
                .iov_len = sizeof(buf),
        };
+       union {
+               struct cmsghdr hdr;
 #ifdef IP_RECVIF
-       unsigned char ctl[CMSG_SPACE(sizeof(struct sockaddr_dl))] = { 0 };
+               uint8_t buf[CMSG_SPACE(sizeof(struct sockaddr_dl))];
 #else
-       unsigned char ctl[CMSG_SPACE(sizeof(struct in_pktinfo))] = { 0 };
+               uint8_t buf[CMSG_SPACE(sizeof(struct in_pktinfo))];
 #endif
+       } cmsgbuf = { .buf = { 0 } };
        struct msghdr msg = {
            .msg_name = &from, .msg_namelen = sizeof(from),
            .msg_iov = &iov, .msg_iovlen = 1,
-           .msg_control = ctl, .msg_controllen = sizeof(ctl),
+           .msg_control = buf, .msg_controllen = sizeof(cmsgbuf.buf),
        };
        int s;
        ssize_t bytes;
diff -r cb9d517b9720 -r 3b6cfba6d818 external/bsd/dhcpcd/dist/src/dhcp6.c
--- a/external/bsd/dhcpcd/dist/src/dhcp6.c      Wed Apr 22 18:26:06 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcp6.c      Thu Apr 23 12:06:09 2020 +0000
@@ -3581,11 +3581,14 @@
                .iov_base = buf,
                .iov_len = sizeof(buf),
        };
-       unsigned char ctl[CMSG_SPACE(sizeof(struct in6_pktinfo))] = { 0 };
+       union {
+               struct cmsghdr hdr;
+               uint8_t buf[CMSG_SPACE(sizeof(struct in6_pktinfo))];
+       } cmsgbuf = { .buf = { 0 } };
        struct msghdr msg = {
            .msg_name = &from, .msg_namelen = sizeof(from),
            .msg_iov = &iov, .msg_iovlen = 1,
-           .msg_control = ctl, .msg_controllen = sizeof(ctl),
+           .msg_control = cmsgbuf.buf, .msg_controllen = sizeof(cmsgbuf.buf),
        };
        int s;
        ssize_t bytes;
diff -r cb9d517b9720 -r 3b6cfba6d818 external/bsd/dhcpcd/dist/src/ipv6nd.c
--- a/external/bsd/dhcpcd/dist/src/ipv6nd.c     Wed Apr 22 18:26:06 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/ipv6nd.c     Thu Apr 23 12:06:09 2020 +0000
@@ -1832,11 +1832,15 @@
                .iov_base = buf,
                .iov_len = sizeof(buf),
        };
-       unsigned char ctl[CMSG_SPACE(sizeof(struct in6_pktinfo)) + CMSG_SPACE(sizeof(int))] = { 0 };
+       union {
+               struct cmsghdr hdr;
+               uint8_t buf[CMSG_SPACE(sizeof(struct in6_pktinfo)) +
+                   CMSG_SPACE(sizeof(int))];
+       } cmsgbuf = { .buf = { 0 } };
        struct msghdr msg = {
            .msg_name = &from, .msg_namelen = sizeof(from),
            .msg_iov = &iov, .msg_iovlen = 1,
-           .msg_control = ctl, .msg_controllen = sizeof(ctl),
+           .msg_control = cmsgbuf.buf, .msg_controllen = sizeof(cmsgbuf.buf),
        };
        ssize_t len;
 



Home | Main Index | Thread Index | Old Index