diff options
-rw-r--r-- | RELNOTES | 4 | ||||
-rw-r--r-- | includes/dhcpd.h | 3 | ||||
-rw-r--r-- | server/ddns.c | 20 | ||||
-rw-r--r-- | server/stables.c | 5 |
4 files changed, 25 insertions, 7 deletions
@@ -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. diff --git a/includes/dhcpd.h b/includes/dhcpd.h index d77f507b..aa8928d8 100644 --- a/includes/dhcpd.h +++ b/includes/dhcpd.h @@ -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 diff --git a/server/ddns.c b/server/ddns.c index b3b71d80..7ef4fecd 100644 --- a/server/ddns.c +++ b/server/ddns.c @@ -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); } diff --git a/server/stables.c b/server/stables.c index 60597fd1..011a9351 100644 --- a/server/stables.c +++ b/server/stables.c @@ -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 } }; |