]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- A new server config option, 'do-reverse-updates', has been added
authorDavid Hankins <dhankins@isc.org>
Tue, 3 Apr 2007 16:46:03 +0000 (16:46 +0000)
committerDavid Hankins <dhankins@isc.org>
Tue, 3 Apr 2007 16:46:03 +0000 (16:46 +0000)
  which causes the server to abstain from performing updates on PTR
  records.  Thanks to a patch from Christof Chen at Allianz.
  [ISC-Bugs #16781]

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

index 956df1ecfecebd4a07b48dd312aeda767ddc22e7..62fc6cd06a3a42e35b7ed06269d8dbf364292158 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -30,6 +30,10 @@ the README file.
 - Some uninitialized values were repaired in dhcpleasequery.c that
   caused the server to abort.
 
+- A new server config option, 'do-reverse-updates', has been added
+  which causes the server to abstain from performing updates on PTR
+  records.  Thanks to a patch from Christof Chen at Allianz.
+
                        Changes since 3.1.0a3
 
 - Some spelling fixes.
index d77f507b00fe6af63739cca9f43983f29a574511..aa8928d811db1b34b83fafe8aa35577295ddd358 100644 (file)
@@ -3,7 +3,7 @@
    Definitions for dhcpd... */
 
 /*
- * Copyright (c) 2004-2005 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1996-2003 by Internet Software Consortium
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -545,6 +545,7 @@ struct lease_state {
 #define SV_DDNS_CONFLICT_DETECT                48
 #define SV_LEASEQUERY                  49
 #define SV_ADAPTIVE_LEASE_TIME_THRESHOLD       50
+#define SV_DO_REVERSE_UPDATES          51
 
 #if !defined (DEFAULT_PING_TIMEOUT)
 # define DEFAULT_PING_TIMEOUT 1
index b3b71d80c5e27121c61f4ac681944987519a37f1..7ef4fecdad5003d4a08c907b085df9da47820ce3 100644 (file)
@@ -3,7 +3,7 @@
    Dynamic DNS updates. */
 
 /*
- * Copyright (c) 2004-2005 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 2000-2003 by Internet Software Consortium
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: ddns.c,v 1.24 2007/03/27 02:47:27 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
+"$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";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -231,6 +231,7 @@ int ddns_updates (struct packet *packet,
        int result = 0;
        isc_result_t rcode1 = ISC_R_SUCCESS, rcode2 = ISC_R_SUCCESS;
        int server_updates_a = 1;
+       int server_updates_ptr = 1;
        struct buffer *bp = (struct buffer *)0;
        int ignorep = 0, client_ignorep = 0;
 
@@ -467,6 +468,17 @@ int ddns_updates (struct packet *packet,
                }
        }
 
+       /* CC: see if we are configured NOT to do reverse ptr updates
+        */
+       if ((oc = lookup_option (&server_universe, state -> options,
+                                SV_DO_REVERSE_UPDATES)) &&
+           !evaluate_boolean_option_cache (&ignorep, packet, lease,
+                                           (struct client_state *)0,
+                                           packet -> options,
+                                           state -> options,
+                                           &lease -> scope, oc, MDL)) {
+               server_updates_ptr = 0;
+       }
 
        /*
         * Compute the reverse IP name.
@@ -561,7 +573,7 @@ int ddns_updates (struct packet *packet,
                                        &ddns_dhcid, ddns_ttl, 0, conflict);
        }
 
-       if (rcode1 == ISC_R_SUCCESS) {
+       if (rcode1 == ISC_R_SUCCESS && server_updates_ptr) {
                if (ddns_fwd_name.len && ddns_rev_name.len)
                        rcode2 = ddns_update_ptr (&ddns_fwd_name,
                                                  &ddns_rev_name, ddns_ttl);
@@ -579,7 +591,7 @@ int ddns_updates (struct packet *packet,
                                       &ddns_dhcid);
        }
 
-       if (rcode2 == ISC_R_SUCCESS) {
+       if (rcode2 == ISC_R_SUCCESS && server_updates_ptr) {
                bind_ds_value (&lease -> scope, "ddns-rev-name",
                               &ddns_rev_name);
        }
index 60597fd1dac2fded7bcc96c648aa357922893980..011a9351cf13da156038072e625b1dc1fc93e138 100644 (file)
@@ -3,7 +3,7 @@
    Tables of information only used by server... */
 
 /*
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1995-2003 by Internet Software Consortium
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: stables.c,v 1.35 2007/01/05 23:19:22 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium.  All rights reserved.\n";
+"$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";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -236,6 +236,7 @@ static struct option server_options[] = {
        { "update-conflict-detection", "f",     &server_universe,  48, 1 },
        { "leasequery", "f",                    &server_universe,  49, 1 },
        { "adaptive-lease-time-threshold", "B", &server_universe,  50, 1 },
+       { "do-reverse-updates", "f",            &server_universe,  51, 1 },
        { NULL, NULL, NULL, 0, 0 }
 };