]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
fix DUID-LTT epoch
authorFrancis Dupont <fdupont@isc.org>
Fri, 15 Feb 2008 18:18:54 +0000 (18:18 +0000)
committerFrancis Dupont <fdupont@isc.org>
Fri, 15 Feb 2008 18:18:54 +0000 (18:18 +0000)
RELNOTES
client/dhc6.c
includes/dhcp6.h
server/dhcpv6.c

index 390ac2efb3fc6f203ddc231189cb977bfd4f86b6..70b3ad6fc5704542bf0b6e371c6c1d1bf4f0ffdb 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -156,6 +156,9 @@ work on other platforms. Please report any problems and suggested fixes to
 - Fix startup error messages to report a missing "subnet6 declaration", rather
   than a missing "subnet declaration", when running as a DHCPv6 server.
 
+- DHCPv6 client timestamp in DUID was based on the year 1970 rather 
+  than the year 2000.
+
                        Changes since 4.0.0b3
 
 - The reverse dns name for PTR updates on IPv6 addresses has been fixed to
index 77376e7bb34b8a21fb50baef12897d0444068ef3..37cdab61f008093749d7817b41b9933d82948978 100644 (file)
@@ -135,7 +135,7 @@ form_duid(struct data_string *duid, const char *file, int line)
        /* Basic Link Local Address type of DUID. */
        putUShort(duid->buffer->data, DUID_LLT);
        putUShort(duid->buffer->data + 2, ip->hw_address.hbuf[0]);
-       putULong(duid->buffer->data + 4, cur_time);
+       putULong(duid->buffer->data + 4, cur_time - DUID_TIME_EPOCH);
        memcpy(duid->buffer->data + 8, ip->hw_address.hbuf + 1,
               ip->hw_address.hlen - 1);
 }
index 414f3898f994cf56c7525c96fd09a748e0b6c96d..c5ed02d910fc1291e4b2dae2d0a1c53ed1252ff9 100644 (file)
@@ -195,3 +195,10 @@ struct dhcpv6_relay_packet {
 
 #define LQ6QT_BY_ADDRESS       1
 #define LQ6QT_BY_CLIENTID      2
+
+/*
+ * DUID time starts 2000-01-01.
+ * This constant is the number of seconds since 1970-01-01,
+ * when the Unix epoch began.
+ */
+#define DUID_TIME_EPOCH 946684800
index a4504c0e6fc1a81b9e4f6fba772912dd2759ae15..f20f5db951e1f43d3b85182776ed97f25f387f57 100644 (file)
@@ -112,13 +112,6 @@ static isc_result_t reply_process_send_addr(struct reply_state *reply,
                                            struct iaddr *addr);
 static struct iaaddr *lease_compare(struct iaaddr *alpha, struct iaaddr *beta);
 
-/*
- * DUID time starts 2000-01-01.
- * This constant is the number of seconds since 1970-01-01,
- * when the Unix epoch began.
- */
-#define DUID_TIME_EPOCH 946684800
-
 /*
  * This function returns the time since DUID time start for the
  * given time_t value.