diff options
author | David Hankins <dhankins@isc.org> | 2006-02-24 23:16:32 +0000 |
---|---|---|
committer | David Hankins <dhankins@isc.org> | 2006-02-24 23:16:32 +0000 |
commit | 88cd8aca9efa1e5b867ac498b98e972638f7aee8 (patch) | |
tree | 8d3015eda99ca77265ed79d15b6e1f0200f6bab3 /common/dns.c | |
parent | b43c87ad595026da002f7acca54bf24318d9fed2 (diff) | |
download | isc-dhcp-88cd8aca9efa1e5b867ac498b98e972638f7aee8.tar.gz |
- Merge changes between 3.0.3RC1 and 3.0.4-BETA-3 into HEAD (silence
robie).
Diffstat (limited to 'common/dns.c')
-rw-r--r-- | common/dns.c | 45 |
1 files changed, 29 insertions, 16 deletions
diff --git a/common/dns.c b/common/dns.c index b6ad19e2..fed20889 100644 --- a/common/dns.c +++ b/common/dns.c @@ -3,7 +3,7 @@ Domain Name Service subroutines. */ /* - * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 2004-2006 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 2001-2003 by Internet Software Consortium * * Permission to use, copy, modify, and distribute this software for any @@ -33,7 +33,7 @@ #ifndef lint static char copyright[] = -"$Id: dns.c,v 1.37 2005/03/17 20:14:58 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n"; +"$Id: dns.c,v 1.38 2006/02/24 23:16:28 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -527,6 +527,7 @@ isc_result_t ddns_update_a (struct data_string *ddns_fwd_name, ns_updrec *updrec; isc_result_t result; char ddns_address [16]; + const char *logstr; if (ddns_addr.len != 4) return ISC_R_INVALIDARG; @@ -712,24 +713,36 @@ isc_result_t ddns_update_a (struct data_string *ddns_fwd_name, */ result = minires_nupdate (&resolver_state, ISC_LIST_HEAD (updqueue)); - if (result != ISC_R_SUCCESS) { - if (result == YXRRSET || result == YXDOMAIN || - result == NXRRSET || result == NXDOMAIN) - log_error ("Forward map from %.*s to %s already in use", - (int)ddns_fwd_name -> len, - (const char *)ddns_fwd_name -> data, - ddns_address); - else - log_error ("Can't update forward map %.*s to %s: %s", + switch (result) { + case ISC_R_SUCCESS: + logstr = NULL; + break; + + case ISC_R_YXRRSET: + case ISC_R_YXDOMAIN: + logstr = "DHCID mismatch, belongs to another client."; + break; + + case ISC_R_NXRRSET: + case ISC_R_NXDOMAIN: + logstr = "Has an A record but no DHCID, not mine."; + break; + + default: + logstr = isc_result_totext(result); + break; + } + + if (logstr != NULL) + log_error("Forward map from %.*s to %s FAILED: %s", (int)ddns_fwd_name -> len, (const char *)ddns_fwd_name -> data, - ddns_address, isc_result_totext (result)); - - } else { - log_info ("Added new forward map from %.*s to %s", + ddns_address, logstr); + else + log_info("Added new forward map from %.*s to %s", (int)ddns_fwd_name -> len, (const char *)ddns_fwd_name -> data, ddns_address); - } + #if defined (DEBUG_DNS_UPDATES) print_dns_status ((int)result, &updqueue); #endif |