]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[v4_1_esv] Always write the DUID to the lease file during startup
authorShawn Routhier <sar@isc.org>
Thu, 16 Apr 2015 02:47:03 +0000 (19:47 -0700)
committerShawn Routhier <sar@isc.org>
Thu, 16 Apr 2015 02:47:03 +0000 (19:47 -0700)
RELNOTES
server/dhcpd.c
server/dhcpd.conf.5

index a75bdff8b424ddeed5b8ce0f6adff6fb3cadeb7f..7aa073ab15b1a5a7762534e16ce5e9809bc2c377 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -80,6 +80,11 @@ by Eric Young (eay@cryptsoft.com).
   and look for the presence of the unicast option there and then globally.
   [ISC-Bugs #21235]
 
+- Write out the DUID server id on startup in all cases, previously if it
+  was read in from server-duid option in the config or lease files for 
+  DHCPv4 it would not be written to the new lease file.
+  [ISC-Bugs #37791]
+
                        Changes since 4.1-ESV-R11rc2
 
 - None
index 50d721eb26dad8810c2576b82e8fbcc663c9a606..991c3688f730e8999cdaa76fcd6d9e87653e67a2 100644 (file)
@@ -762,19 +762,21 @@ main(int argc, char **argv) {
 
 #ifdef DHCPv6
        /*
-        * Set server DHCPv6 identifier.
+        * Set server DHCPv6 identifier - we go in order:
+        * dhcp6.server-id in the config file
+        * server-duid from the lease file
+        * server-duid from the config file (the config file is read first
+        * and the lease file overwrites the config file information)
+        * genrate a new one
+        * In all cases we write it out to the lease file.
         * See dhcpv6.c for discussion of setting DUID.
         */
-       if (set_server_duid_from_option() == ISC_R_SUCCESS) {
-               write_server_duid();
-       } else {
-               if (!server_duid_isset()) {
-                       if (generate_new_server_duid() != ISC_R_SUCCESS) {
-                               log_fatal("Unable to set server identifier.");
-                       }
-                       write_server_duid();
-               }
+       if ((set_server_duid_from_option() != ISC_R_SUCCESS) &&
+           (!server_duid_isset()) &&
+           (generate_new_server_duid() != ISC_R_SUCCESS)) {
+               log_fatal("Unable to set server identifier.");
        }
+       write_server_duid();
 #endif /* DHCPv6 */
 
 #ifndef DEBUG
index b831a5b0e6a2707db842483aa557028d10f1ba4f..0514024b07e972bd72703438d10e22a90f5a8fad 100644 (file)
@@ -2728,6 +2728,10 @@ Otherwise the server will generate a DUID of the specified type.
 If you choose EN, you must include the enterprise number and the
 enterprise-identifier.
 .PP
+If there is a server-duid statement in the lease file it will take precedence
+over the server-duid statement from the config file and a
+dhcp6.server-id option in the config file will override both.
+.PP
 The default server-duid type is LLT.
 .RE
 .PP