]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
A new server config option "fqdn-reply" specifies whether the server
authorEvan Hunt <each@isc.org>
Fri, 27 Apr 2007 22:48:00 +0000 (22:48 +0000)
committerEvan Hunt <each@isc.org>
Fri, 27 Apr 2007 22:48:00 +0000 (22:48 +0000)
should send out option 81 (FQDN).  Defaults to "on".  If set to "off",
the FQDN option is not sent, even if the client requested it.  This is
needed because some clients misbehave otherwise. [rt16624]

RELNOTES
includes/dhcpd.h
server/ddns.c
server/stables.c

index 25000f802f90f6ffdb65afabcff320b370a59455..dd67d5b8e0b5e13701178ed758f22b531414078c 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -27,6 +27,12 @@ the README file.
 
                        Changes since 3.1.0b1
 
+- A new server config option "fqdn-reply" specifies whether the server
+  should send out option 81 (FQDN).  Defaults to "on".  If set to "off",
+  the FQDN option is not sent, even if the client requested it.  This is
+  needed because some clients misbehave otherwise.  Thanks to Christof Chen
+  at Allianz.
+
 - Allow trace output files (-tf option) to be overwritten, rather than
   crashing dhcpd if the file already exists
 
index 276e50d90a91ce1e5f6f1b0930ab81fc43354ced..c52a912549d42b7a34c21527d061e617d02bb793 100644 (file)
@@ -552,6 +552,7 @@ struct lease_state {
 #define SV_LEASEQUERY                  49
 #define SV_ADAPTIVE_LEASE_TIME_THRESHOLD       50
 #define SV_DO_REVERSE_UPDATES          51
+#define SV_FQDN_REPLY                  52
 
 #if !defined (DEFAULT_PING_TIMEOUT)
 # define DEFAULT_PING_TIMEOUT 1
index 7ef4fecdad5003d4a08c907b085df9da47820ce3..3e833d637c06e802eab3881b96ecb95d7b73bd57 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: ddns.c,v 1.25 2007/04/03 16:46:03 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: ddns.c,v 1.26 2007/04/27 22:48:00 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -597,6 +597,21 @@ int ddns_updates (struct packet *packet,
        }
 
       noerror:
+       /*
+        * If fqdn-reply option is disabled in dhcpd.conf, then don't
+        * send the client an FQDN option at all, even if one was requested.
+        * (WinXP clients allegedly misbehave if the option is present,
+        * refusing to handle PTR updates themselves).
+        */
+       if ((oc = lookup_option (&server_universe, state->options,
+                                SV_FQDN_REPLY)) &&
+           !evaluate_boolean_option_cache (&ignorep, packet, lease,
+                                           (struct client_state *)0,
+                                           packet->options,
+                                           state->options,
+                                           &lease->scope, oc, MDL)) {
+               goto badfqdn;
+
        /* If we're ignoring client updates, then we tell a sort of 'white
         * lie'.  We've already updated the name the server wants (per the
         * config written by the server admin).  Now let the client do as
@@ -605,7 +620,7 @@ int ddns_updates (struct packet *packet,
         * We only form an FQDN option this way if the client supplied an
         * FQDN option that had FQDN_SERVER_UPDATE set false.
         */
-       if (client_ignorep &&
+       } else if (client_ignorep &&
            (oc = lookup_option(&fqdn_universe, packet->options,
                                FQDN_SERVER_UPDATE)) &&
            !evaluate_boolean_option_cache(&ignorep, packet, lease, NULL,
index 011a9351cf13da156038072e625b1dc1fc93e138..3d68e18030f4773d01089e6c3c5012138a9ccbb4 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: stables.c,v 1.36 2007/04/03 16:46:03 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: stables.c,v 1.37 2007/04/27 22:48:00 each Exp $ Copyright (c) 2004-2007 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -237,6 +237,7 @@ static struct option server_options[] = {
        { "leasequery", "f",                    &server_universe,  49, 1 },
        { "adaptive-lease-time-threshold", "B", &server_universe,  50, 1 },
        { "do-reverse-updates", "f",            &server_universe,  51, 1 },
+       { "fqdn-reply", "f",                    &server_universe,  52, 1 },
        { NULL, NULL, NULL, 0, 0 }
 };