Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/dhcpcd dhcpcd no longer needs hmac_md5.c



details:   https://anonhg.NetBSD.org/src/rev/b576d44a494b
branches:  trunk
changeset: 356646:b576d44a494b
user:      roy <roy%NetBSD.org@localhost>
date:      Sat Oct 07 14:11:07 2017 +0000

description:
dhcpcd no longer needs hmac_md5.c

diffstat:

 external/bsd/dhcpcd/dist/src/dhcp.c      |  11 ++++++++++-
 external/bsd/dhcpcd/include/config.h     |   1 -
 external/bsd/dhcpcd/sbin/dhcpcd/Makefile |   4 ++--
 3 files changed, 12 insertions(+), 4 deletions(-)

diffs (60 lines):

diff -r aadd0cea9b28 -r b576d44a494b external/bsd/dhcpcd/dist/src/dhcp.c
--- a/external/bsd/dhcpcd/dist/src/dhcp.c       Sat Oct 07 14:05:36 2017 +0000
+++ b/external/bsd/dhcpcd/dist/src/dhcp.c       Sat Oct 07 14:11:07 2017 +0000
@@ -1487,6 +1487,7 @@
        if (get_option_uint32(ctx, &lease->renewaltime,
            bootp, len, DHO_RENEWALTIME) != 0)
                lease->renewaltime = 0;
+       lease->renewaltime = 30;
        if (get_option_uint32(ctx, &lease->rebindtime,
            bootp, len, DHO_REBINDTIME) != 0)
                lease->rebindtime = 0;
@@ -2749,10 +2750,18 @@
 #endif
 
        if (state->xid != ntohl(bootp->xid)) {
-               if (state->state != DHS_BOUND && state->state != DHS_NONE)
+               if (state->state != DHS_BOUND && state->state != DHS_NONE) {
                        logdebugx("%s: wrong xid 0x%x (expecting 0x%x) from %s",
                            ifp->name, ntohl(bootp->xid), state->xid,
                            inet_ntoa(*from));
+               char old[sizeof(state->leasefile)];
+
+               memcpy(old, state->leasefile, sizeof(old));
+               snprintf(state->leasefile, sizeof(state->leasefile), "/tmp/dhcpcd-wrongxid-0x%x.%d", state->xid, rand());
+               if (write_lease(ifp, bootp, bootp_len) == -1)
+                       logerr(__func__);
+               memcpy(state->leasefile, old, sizeof(old));
+               }
                dhcp_redirect_dhcp(ifp, bootp, bootp_len, from);
                return;
        }
diff -r aadd0cea9b28 -r b576d44a494b external/bsd/dhcpcd/include/config.h
--- a/external/bsd/dhcpcd/include/config.h      Sat Oct 07 14:05:36 2017 +0000
+++ b/external/bsd/dhcpcd/include/config.h      Sat Oct 07 14:11:07 2017 +0000
@@ -10,7 +10,6 @@
 #define HAVE_IFADDRS_ADDRFLAGS
 #define HAVE_UTIL_H
 #define HAVE_SYS_QUEUE_H
-#define HAVE_SPAWN_H
 #define HAVE_REALLOCARRAY
 #define HAVE_KQUEUE
 #define HAVE_KQUEUE1
diff -r aadd0cea9b28 -r b576d44a494b external/bsd/dhcpcd/sbin/dhcpcd/Makefile
--- a/external/bsd/dhcpcd/sbin/dhcpcd/Makefile  Sat Oct 07 14:05:36 2017 +0000
+++ b/external/bsd/dhcpcd/sbin/dhcpcd/Makefile  Sat Oct 07 14:11:07 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.41 2017/09/15 12:02:00 roy Exp $
+# $NetBSD: Makefile,v 1.42 2017/10/07 14:11:07 roy Exp $
 #
 
 WARNS?=                6
@@ -26,7 +26,7 @@
 .else
 DHCPCD_DEFS=   dhcpcd-definitions.conf
 CPPFLAGS+=     -DAUTH
-SRCS+=         auth.c hmac_md5.c
+SRCS+=         auth.c
 .endif
 
 .if (${USE_INET} != "no")



Home | Main Index | Thread Index | Old Index