Commit 88cd8aca authored by David Hankins's avatar David Hankins

- Merge changes between 3.0.3RC1 and 3.0.4-BETA-3 into HEAD (silence

  robie).
parent b43c87ad
# Copyright (c) 2004-2005 by Internet Systems Consortium, Inc. ("ISC")
# Copyright (c) 2004-2006 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
......
......@@ -367,6 +367,18 @@ Linux 2.1 and later kernels do not use SO_BINDTODEVICE or require the
broadcast address hack, but do support multiple interfaces, using the
Linux Packet Filter.
LINUX: 802.1q VLAN INTERFACES
If you're using 802.1q vlan interfaces on Linux, it is necessary to
vconfig the subinterface(s) to rewrite the 802.1q information out of
packets received by the dhcpd daemon via LPF:
vconfig set_flag eth1.523 1 1
Note that this may affect the performance of your system, since the
Linux kernel must rewrite packets received via this interface. For
more information, consult the vconfig man pages.
SCO
SCO has the same problem as Linux (described earlier). The thing is,
......@@ -446,18 +458,24 @@ systems, although it may occur with other systems as well. If you
encounter this symptom, and you are running the DHCP server on a
machine with a single broadcast network interface, you may wish to
edit the includes/site.h file and uncomment the #define USE_SOCKETS
line. Then type ``make clean; make''.
line. Then type ``make clean; make''. As an alternative workaround,
it has been reported that running 'snoop' will cause the dhcp server
to start receiving packets. So the practice reported to us is to run
snoop at dhcpd startup time, with arguments to cause it to receive one
packet and exit.
snoop -c 1 udp port 67 > /dev/null &
The DHCP client on Solaris will only work with DLPI. If you run it
and it just keeps saying it's sending DHCPREQUEST packets, but never
gets a response, you may be having DLPI trouble as described above.
If so, we have no solution to offer at this time. Also, because
Solaris requires you to "plumb" an interface before it can be detected
by the DHCP client, you must either specify the name(s) of the
interface(s) you want to configure on the command line, or must plumb
the interfaces prior to invoking the DHCP client. This can be done
with ``ifconfig iface plumb'', where iface is the name of the
interface (e.g., ``ifconfig hme0 plumb'').
If so, we have no solution to offer at this time, aside from the above
workaround which should also work here. Also, because Solaris requires
you to "plumb" an interface before it can be detected by the DHCP client,
you must either specify the name(s) of the interface(s) you want to
configure on the command line, or must plumb the interfaces prior to
invoking the DHCP client. This can be done with ``ifconfig iface plumb'',
where iface is the name of the interface (e.g., ``ifconfig hme0 plumb'').
It should be noted that Solaris versions from 2.6 onward include a
DHCP client that you can run with ``/sbin/ifconfig iface dhcp start''
......
......@@ -63,6 +63,144 @@ and for prodding me into improving it.
- RFC3942 compliance, site-local option spaces start at 224 now, not 128.
||| THIS NEEDS TO BE SPELLED OUT IN THE NEW FEATURES LIST |||
Changes since 3.0.4b2
- Null-termination sensing for certain clients that unfortunatley require
it in DHCPINFORM processing was repaired.
- The host-name option and a few others were moved from "X" format to "t"
format to be compatible with new NULL handling functions.
- DHCPINFORM processing is a little more careful about return addressing
its responses, or if responding via a relay. The INFORM related
messages also log the 'effective client ip address' rather than the
client's supplied ciaddr (since some clients produce null ciaddrs).
- The server was inappropriately sending leases to the RESET state in the
event that multiple active leases were found to match a singly-identified
client. This was changed to RELEASED (by accepting a different, ACTIVE
binding, the client is implicitly releasing its lease). This repairs a
bug wherein secondary servers in failover pairs detecting this condition
move leases to RESET, and primaries refuse to accept that state
transition (properly).
- The memset-after-dmalloc() changes made in 3.0.4b1 have been backed out.
Changes since 3.0.4b1
- Command line parsing in omshell was repaired - it no longer closes
STDIN after reading one line.
- The resolver library no longer closes the /etc/resolv.conf file
descriptor it opened twice.
- Changes to trailing NULL removal in 't' option-atoms has been rethought,
it now includes 'd' (domain name) types, and tries hard not to rewind an
option beyond the start of the text field it is un-terminating.
Changes since 3.0.3
- A DDNS update handling function was misusing the DNS error codes, rather
than the internal generic result enumeration. The result is a confusing
syslog line, logging the wrong condition.
- The DHCP Server was not checking pool balance in the case where it brought
a non-ACTIVE lease out of storage for a client that was returning to use
a lease it once had long ago, and had since expired.
- Failover peers no longer bother to look for free leases to allocate when
they already found the client's ACTIVE lease. DISCOVERs are load balanced
wether freely-allocated or not, unless the server doubts the peer has
leases to allocate.
- Fixed a bug in dhcrelay agent addition code that suppressed trailing
PAD options - it was suppressing only one trailng PAD option, rather
than the entire block of them.
- Fixed some unlikely overlapping-region memcpy() bugs in dhcrelay agent
option addition and stripping code. Added a few sanity checks.
- Added some sanity checks to OMAPI connection/authentication code.
- dmalloc() memset()'s the non-debug (data) portion of the allocated
memory to zero. Code that memset()'s the result returned by dmalloc() to
zero is redundant. These redundancies were removed.
- Some type declaration corrections to u_int16_t were made in common/tr.c
(Token Ring support) thanks to a patch from Jason Vas Dias at RedHat.
- A failover bug that was allowing leases that EXPIRED or were RELEASED
where tsfp and tstp are identical timestamps to languish in these
transitional states has been repaired. As a side effect, lease
databases should be kept more consistent overall, not just for these
transitional states.
- If the lease db is deleted out from under the daemon, and it moves to rewrite
the db, it will go ahead with the operation and move the new db into place
once it detects the old db does not exist.
- dhclient now ignores IRDA, SIT, and IEEE1394 network interfaces, as it
is either nonsensical or (in the case of IEEE1394) is not known to support
these interfaces. Thanks to Marius Gedminas and Andrew Pollock of Debian.
- Some previously undocumented reasons for dhclient-script invoking has
been doucmented in the dhclient-script.8 manpage.
- Failover potential expiry calculations (TSTP) have been corrected. Results
should be substantially more consistent, and proper given the constraints.
- Adjusted lease state validation checks in potential-conflict, to
account for possible clock skew similarly to normal state, and several
previously illegal transitions were made legal (ex: active->released).
- An impossible sanity check was removed from omapi/buffer.c, thanks to a
patch from 'infamous42md'.
- An OMAPI host/network byte order problem in lease time values has been
repaired.
- Several minor bugs, largely relating to treating 8-byte time values as
4-byte entities, have been repaired after careful review of the FreeBSD
ports collection's patch set. Thanks to the nameless entities who have
contributed to the FreeBSD ports.
- When writing a trace file, the file is now created with permissions 0600,
to help administrators avoid accidentally publicising sensitive config
data.
- The calculation of the maximum size of DHCP packets no longer includes
Ethernet framing overhead. The result is that the 'Maximum Message
Size' option advertised by clients, or the default value 576, is no
longer reduced by 14 bytes, and instead directly reflects the IP level
MTU (and the default, minimum allowed IP MTU of 576).
- The special status of RELEASED/EXPIRED/RESET leases when a server
is operating in partner-down was fixed. It no longer requires a
lease be twice the MCLT beyond STOS to 'reallocate', and the expiry
event to turn these into FREE leases without peer acknowledgement
(after STOS+MCLT) has been repaired.
- Compilation on older Solaris systems (lacking /usr/include/sys/int_types.h)
has been repaired.
- "append"ing a string onto the end of a "t" type option (such as the
domain-name field) that had been improperly NULL-terminated by the
DHCP server will no longer result in a truncated string containing
only the option from the server, and not the expected appended value.
Thanks to a patch from Jason Vas Dias at RedHat.
- File handlers on configuration state (config files and lease dbs) should
be treated consistently, regardless of wether TRACING is defined or not.
- The linux build environment has had some minor improvements - better
sensing of 64-bit pointer sizes (only used for establishing an icmp_id),
and corrections to #if operators regarding LINUX_MAJOR should it ever
move to 3.[01].x.
- The server now tries harder to survive the condition where it is unable
to open a new lease file to rewrite the lease state database.
Changes since 3.0.3b3
- dhclient.conf documentation for interface {} was updated to reflect recent
......
......@@ -3,7 +3,7 @@
Parser for dhclient config and lease files... */
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2006 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
......@@ -34,7 +34,7 @@
#ifndef lint
static char copyright[] =
"$Id: clparse.c,v 1.64 2005/03/17 20:14:55 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
"$Id: clparse.c,v 1.65 2006/02/24 23:16:27 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -173,7 +173,6 @@ int read_client_conf_file (const char *name, struct interface_info *ip,
status = (cfile -> warnings_occurred
? ISC_R_BADPARSE
: ISC_R_SUCCESS);
close (file);
end_parse (&cfile);
return status;
}
......@@ -210,7 +209,6 @@ void read_client_leases ()
} while (1);
close (file);
end_parse (&cfile);
}
......@@ -774,7 +772,13 @@ int interface_or_dummy (struct interface_info **pi, const char *name)
if ((status = interface_allocate (&ip, MDL)) != ISC_R_SUCCESS)
log_fatal ("Can't record interface %s: %s",
name, isc_result_totext (status));
strcpy (ip -> name, name);
if (strlen(name) >= sizeof(ip->name)) {
interface_dereference(&ip, MDL);
return 0;
}
strcpy(ip->name, name);
if (dummy_interfaces) {
interface_reference (&ip -> next,
dummy_interfaces, MDL);
......@@ -994,7 +998,8 @@ void parse_client_lease_declaration (cfile, lease, ipp, clientp)
skip_to_semi (cfile);
break;
}
interface_or_dummy (ipp, val);
if (!interface_or_dummy (ipp, val))
log_fatal ("Can't allocate interface %s.", val);
break;
case NAME:
......
.\" dhclient-script.8
.\"
.\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (c) 2004-2005 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
......@@ -28,7 +28,7 @@
.\" see ``http://www.vix.com''. To learn more about Nominum, Inc., see
.\" ``http://www.nominum.com''.
.\"
.\" $Id: dhclient-script.8,v 1.10 2005/03/17 20:14:55 dhankins Exp $
.\" $Id: dhclient-script.8,v 1.11 2006/02/24 23:16:27 dhankins Exp $
.\"
.TH dhclient-script 8
.SH NAME
......@@ -97,7 +97,8 @@ defines a set of variables in the environment, and then invokes
.B CLIENTBINDIR/dhclient-script.
In all cases, $reason is set to the name of the reason why the script
has been invoked. The following reasons are currently defined:
MEDIUM, PREINIT, BOUND, RENEW, REBIND, REBOOT, EXPIRE, FAIL and TIMEOUT.
MEDIUM, PREINIT, BOUND, RENEW, REBIND, REBOOT, EXPIRE, FAIL, STOP, RELEASE,
NBI and TIMEOUT.
.PP
.SH MEDIUM
The DHCP client is requesting that an interface's media type
......@@ -175,6 +176,18 @@ The DHCP client has been unable to contact any DHCP servers, and any
leases that have been tested have not proved to be valid. The
parameters from the last lease tested should be deconfigured. This
can be handled in the same way as EXPIRE.
.SH STOP
The dhclient has been informed to shut down gracefully, the
dhclient-script should unconfigure or shutdown the interface as
appropriate.
.SH RELEASE
The dhclient has been executed using the -r flag, indicating that the
administrator wishes it to release its lease(s). dhclient-script should
unconfigure or shutdown the interface.
.SH NBI
No-Broadcast-Interfaces...dhclient was unable to find any interfaces
upon which it believed it should commence DHCP. What dhclient-script
should do in this situation is entirely up to the implementor.
.SH TIMEOUT
The DHCP client has been unable to contact any DHCP servers.
However, an old lease has been identified, and its parameters have
......
......@@ -24,7 +24,7 @@
.\" Support and other services are available for ISC products - see
.\" http://www.isc.org for more information.
.\"
.\" $Id: dhclient.8,v 1.17 2005/03/17 20:14:55 dhankins Exp $
.\" $Id: dhclient.8,v 1.18 2006/02/24 23:16:27 dhankins Exp $
.\"
.TH dhclient 8
.SH NAME
......@@ -39,6 +39,10 @@ dhclient - Dynamic Host Configuration Protocol Client
.B -d
]
[
.B -e
.I VAR=value
]
[
.B -q
]
[
......@@ -188,6 +192,15 @@ flag should be specified. This is useful when running the client
under a debugger, or when running it out of inittab on System V
systems.
.PP
The dhclient daemon creates its own environment when executing the
dhclient-script to do the grunt work of interface configuration.
To define extra environment variables and their values, use the
.B -e
flag, followed by the environment variable name and value assignment,
just as one would assign a variable in a shell. Eg:
.B -e
.I IF_METRIC=1
.PP
The client normally prints a startup message and displays the
protocol sequence to the standard error descriptor until it has
acquired an address, and then only logs messages using the
......@@ -238,7 +251,7 @@ broadcast interface may be added after system startup. The
.B -w
flag can be used to cause the client not to exit when it doesn't find
any such interfaces. The
.B omshell (8)
.B omshell (1)
program can then be used to notify the client when a network interface
has been added or removed, so that the client can attempt to configure an IP
address on that interface.
......
......@@ -3,7 +3,7 @@
DHCP Client. */
/*
* Copyright (c) 2004-2005 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2006 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
......@@ -32,7 +32,7 @@
#ifndef lint
static char ocopyright[] =
"$Id: dhclient.c,v 1.132 2005/03/17 20:14:55 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium. All rights reserved.\n";
"$Id: dhclient.c,v 1.133 2006/02/24 23:16:27 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -212,10 +212,10 @@ int main (argc, argv, envp)
if (status != ISC_R_SUCCESS)
log_fatal ("Can't record interface %s:%s",
argv [i], isc_result_totext (status));
if (strlen (argv [i]) > sizeof tmp -> name)
log_fatal ("%s: interface name too long (max %ld)",
argv [i], (long)strlen (argv [i]));
strcpy (tmp -> name, argv [i]);
if (strlen(argv[i]) >= sizeof(tmp->name))
log_fatal("%s: interface name too long (is %ld)",
argv [i], (long)strlen(argv[i]));
strcpy(tmp->name, argv[i]);
if (interfaces) {
interface_reference (&tmp -> next,
interfaces, MDL);
......@@ -789,11 +789,9 @@ void dhcpack (packet)
client -> new -> renewal = TIME_MAX;
/* Now introduce some randomness to the renewal time: */
if (client -> new -> renewal <= TIME_MAX / 3 - 3)
client -> new -> renewal =
(((client -> new -> renewal + 3) * 3 / 4) +
(random () % /* XXX NUMS */
((client -> new -> renewal + 3) / 4)));
if (client->new->renewal <= ((TIME_MAX / 3) - 3))
client->new->renewal = (((client->new->renewal * 3) + 3) / 4) +
(((random() % client->new->renewal) + 3) / 4);
/* Same deal with the rebind time. */
oc = lookup_option (&dhcp_universe, client -> new -> options,
......@@ -1404,22 +1402,17 @@ void send_discover (cpp)
between zero and two times itself. On average, this means
that it will double with every transmission. */
if (increase) {
if (!client -> interval)
client -> interval =
client -> config -> initial_interval;
if (!client->interval)
client->interval = client->config->initial_interval;
else
client -> interval += ((random () >> 2) %
(2 * client -> interval));
client->interval += random() % (2 * client->interval);
/* Don't backoff past cutoff. */
if (client -> interval >
client -> config -> backoff_cutoff)
client -> interval =
((client -> config -> backoff_cutoff / 2)
+ ((random () >> 2) %
client -> config -> backoff_cutoff));
} else if (!client -> interval)
client -> interval = client -> config -> initial_interval;
if (client->interval > client->config->backoff_cutoff)
client->interval = (client->config->backoff_cutoff / 2)
+ (random() % client->config->backoff_cutoff);
} else if (!client->interval)
client->interval = client->config->initial_interval;
/* If the backoff would take us to the panic timeout, just use that
as the interval. */
......
......@@ -3,7 +3,7 @@
Memory allocation... */
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2006 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
......@@ -34,7 +34,7 @@
#ifndef lint
static char copyright[] =
"$Id: alloc.c,v 1.55 2005/03/17 20:14:56 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
"$Id: alloc.c,v 1.56 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"
......
......@@ -3,7 +3,7 @@
OMAPI object interfaces for the DHCP server. */
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2006 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1999-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
......@@ -41,7 +41,7 @@
#ifndef lint
static char copyright[] =
"$Id: comapi.c,v 1.11 2005/03/17 20:14:57 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
"$Id: comapi.c,v 1.12 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"
......
......@@ -3,7 +3,7 @@
Lexical scanner for dhcpd config file... */
/*
* Copyright (c) 2004-2005 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2006 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: conflex.c,v 1.95 2005/03/17 20:14:57 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium. All rights reserved.\n";
"$Id: conflex.c,v 1.96 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"
......@@ -95,10 +95,14 @@ isc_result_t new_parse (cfile, file, inbuf, buflen, name, eolp)
isc_result_t end_parse (cfile)
struct parse **cfile;
{
if ((*cfile) -> bufsiz)
dfree ((*cfile) -> inbuf, MDL);
dfree (*cfile, MDL);
*cfile = (struct parse *)0;
/* "Memory" config files have no file. */
if ((*cfile)->file != -1)
close((*cfile)->file);
if ((*cfile)->bufsiz)
dfree((*cfile)->inbuf, MDL);
dfree(*cfile, MDL);
*cfile = NULL;
return ISC_R_SUCCESS;
}
......@@ -464,7 +468,7 @@ static enum dhcp_token read_number (c, cfile)
log_fatal("read_number():%s:%d: impossible case", MDL);
}
#else /* OLD_LEXER */
if (!seenx && (c == 'x') {
if (!seenx && (c == 'x')) {
seenx = 1;
} else if (!isascii (c) || !isxdigit (c)) {
if (c != EOF) {
......@@ -573,6 +577,8 @@ static enum dhcp_token intern (atom, dfv)
return ADDRESS;
if (!strcasecmp (atom + 1, "ctive"))
return TOKEN_ACTIVE;
if (!strcasecmp (atom + 1, "tsfp"))
return ATSFP;
break;
case 'b':
if (!strcasecmp (atom + 1, "ackup"))
......
......@@ -3,7 +3,7 @@
Network input dispatcher... */
/*
* Copyright (c) 2004-2005 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2006 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: discover.c,v 1.48 2005/03/17 20:14:57 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium. All rights reserved.\n";
"$Id: discover.c,v 1.49 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"
......@@ -463,6 +463,18 @@ void discover_interfaces (state)
#ifdef HAVE_ARPHRD_ROSE
case ARPHRD_ROSE:
#endif
#ifdef HAVE_ARPHRD_IRDA
case ARPHRD_IRDA:
/* ignore infrared interfaces. */
#endif
#ifdef HAVE_ARPHRD_SIT
case ARPHRD_SIT:
/* ignore IPv6-in-IPv4 interfaces. */
#endif
#ifdef HAVE_ARPHRD_IEEE1394
case ARPHRD_IEEE1394:
/* ignore IEEE1394 interfaces. */
#endif
#ifdef HAVE_ARPHRD_LOOPBACK
case ARPHRD_LOOPBACK:
/* ignore loopback interface */
......
......@@ -3,7 +3,7 @@
Network input dispatcher... */
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2006 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: dispatch.c,v 1.65 2005/03/17 20:14:57 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
"$Id: dispatch.c,v 1.66 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"
......@@ -42,7 +42,7 @@ static char copyright[] =
struct timeout *timeouts;
static struct timeout *free_timeouts;
void set_time (u_int32_t t)
void set_time(TIME t)
{
/* Do any outstanding timeouts. */
if (cur_time != t) {
......
......@@ -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: