Commit 98311e4b authored by David Hankins's avatar David Hankins

MASSIVE merge from V3-RELEASE-BRANCH into HEAD. HEAD and V3-RELEASE are

now synced as of tag V3-0-3-BETA-1.
parent c570dfe6
# Makefile
#
# Copyright (c) 2000 Internet Software Consortium.
# All rights reserved.
# Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
# Copyright (c) 1995-2003 by Internet Software Consortium
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of Internet Software Consortium nor the names
# of its contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
# CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
# Internet Systems Consortium, Inc.
# 950 Charter Street
# Redwood City, CA 94063
# <info@isc.org>
# http://www.isc.org/
#
# This software has been written for the Internet Software Consortium
# This software has been written for Internet Systems Consortium
# by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
# To learn more about the Internet Software Consortium, see
# To learn more about Internet Systems Consortium, see
# ``http://www.isc.org/''. To learn more about Vixie Enterprises,
# see ``http://www.vix.com''. To learn more about Nominum, Inc., see
# ``http://www.nominum.com''.
#
all:
@sysname=`./configure --print-sysname`; \
......
# Makefile.conf
#
# Copyright (c) 1996-2000 Internet Software Consortium.
# Use is subject to license terms which appear in the file named
# ISC-LICENSE that should have accompanied this file when you
# received it. If a file named ISC-LICENSE did not accompany this
# file, or you are not sure the one you have is correct, you may
# obtain an applicable copy of the license at:
# Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
# Copyright (c) 1995-2003 by Internet Software Consortium
#
# http://www.isc.org/isc-license-1.0.html.
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# This file is part of the ISC DHCP distribution. The documentation
# associated with this file is listed in the file DOCUMENTATION,
# included in the top-level directory of this release.
#
# Support and other services are available for ISC products - see
# http://www.isc.org for more information.
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# Internet Systems Consortium, Inc.
# 950 Charter Street
# Redwood City, CA 94063
# <info@isc.org>
# http://www.isc.org/
## Defaults...
SCRIPT = none
......@@ -200,6 +204,7 @@ MINORVERSION=MinorVersion
## FreeBSD
##--freebsd--
#CF = cf/freebsd.h
#COPTS = -O -Wall -Wno-unused -Werror $(CC_OPTIONS)
#SCRIPT=freebsd
##--freebsd--
......@@ -216,7 +221,7 @@ MINORVERSION=MinorVersion
#CF = cf/rhapsody.h
#COPTS = -Ddarwin -Wall -Wno-unused -Wno-implicit -Wno-comment \
# -Wno-uninitialized -Wno-switch -Werror -pipe $(BINDDEF) $(CC_OPTIONS)
##SCRIPT=rhapsody
#SCRIPT=freebsd
##--darwin--
## NetBSD
......@@ -225,28 +230,11 @@ MINORVERSION=MinorVersion
#COPTS = -Wall -Wstrict-prototypes -Wno-unused -Wno-comment \
# -Wno-uninitialized -Werror \
# -Wimplicit-function-declaration -Wpointer-arith -Wcast-qual \
# -Wcast-align -Wwrite-strings -Wconversion -Wmissing-prototypes \
# -Wmissing-declarations -Wnested-externs \
# -pipe $(BINDDEF) $(CC_OPTIONS)
#SCRIPT=netbsd
##MKDEP=makedepend
##--netbsd--
## NetBSD nocast
## Some versions of the arm32 gcc have a problem in cast conversions.
## The Alpha definitely has a problem - if you pass '6' where a size_t
## is expected, you get a warning. So on these architectures, we do
## not ask for that sort of warning.
##--netbsd-nocast--
#CF = cf/netbsd.h
#COPTS = -Wall -Wstrict-prototypes -Wno-unused -Wno-comment \
# -Wno-uninitialized -Werror \
# -Wimplicit-function-declaration -Wpointer-arith -Wcast-qual \
# -Wwrite-strings -Wmissing-prototypes \
# -Wmissing-declarations -Wnested-externs \
# -pipe $(BINDDEF) $(CC_OPTIONS)
#SCRIPT=netbsd
##--netbsd-nocast--
##--netbsd--
## Ultrix
##--ultrix--
......
# Makefile.dist
#
# Copyright (c) 1996-1999 Internet Software Consortium.
# Use is subject to license terms which appear in the file named
# ISC-LICENSE that should have accompanied this file when you
# received it. If a file named ISC-LICENSE did not accompany this
# file, or you are not sure the one you have is correct, you may
# obtain an applicable copy of the license at:
# Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
# Copyright (c) 1995-2003 by Internet Software Consortium
#
# http://www.isc.org/isc-license-1.0.html.
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# This file is part of the ISC DHCP distribution. The documentation
# associated with this file is listed in the file DOCUMENTATION,
# included in the top-level directory of this release.
#
# Support and other services are available for ISC products - see
# http://www.isc.org for more information.
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# Internet Systems Consortium, Inc.
# 950 Charter Street
# Redwood City, CA 94063
# <info@isc.org>
# http://www.isc.org/
SUBDIRS= common $(MINIRES) dst omapip server client relay dhcpctl
......
Internet Software Consortium DHCP Distribution
Version 3.1 - DEVELOPMENT
May 26, 2002
Internet Systems Consortium DHCP Distribution
Version 3.1 - HEAD
March 3, 2005
README FILE
README FILE
You should read this file carefully before trying to install or use
the ISC DHCP Distribution.
......@@ -96,15 +96,15 @@ system.
RELEASE STATUS
This is the second beta release of version 3.0 of the ISC DHCP
Distribution. Development of this release is approaching the point at
which it will be frozen, and no significant new features will be
added.
This is a snapshot of the ISC DHCP project's CVS HEAD prior to release
version 3.1.x. This is highly experimental code which has not been
publically released, nor properly tested. It contains a large number of
new features, and with it most likely many bugs.
In this release, the server and relay agent are currently fully
functional on NetBSD, Linux systems with kernel version 2.2 or later,
FreeBSD, OpenBSD, BSD/OS, Digital Tru64 Unix and Solaris. The
software will also run on HP-UX, but only supports a single network
FreeBSD, OpenBSD, BSD/OS, Digital Tru64 Unix and Solaris. The software
will also run on AIX and HP-UX, but only supports a single network
interface. Ports also exist for QNX, SCO, NeXTStep, and MacOS X, but
are not in wide use, with all that implies. We are not aware of an
easy way to get this software running on HP-UX.
......@@ -142,17 +142,17 @@ information. On Digital Unix, type ``man pfilt''.
To build the DHCP Distribution, unpack the compressed tar file using
the tar utility and the gzip command - type something like:
zcat dhcp-3.0rc3.tar.gz |tar xvf -
zcat dhcp-3.1-HEAD.tar.gz |tar xvf -
On BSD/OS, you have to type gzcat, not zcat, and you may run into
similar problems on other operating systems.
CONFIGURING IT
Now, cd to the dhcp-3.0rc3 subdirectory that you've just
created and configure the source tree by typing:
Now, cd to the dhcp-3.1-HEAD subdirectory that you've just created and
configure the source tree by typing:
./configure
./configure
If the configure utility can figure out what sort of system you're
running on, it will create a custom Makefile for you for that
......@@ -243,16 +243,6 @@ network interface. There are also two potential compilation/runtime
problems for Linux 2.1/2.2: the "SO_ATTACH_FILTER undeclared" problem
and the "protocol not configured" problem.
LINUX: IF_TR.H NOT FOUND
When you compile the distribution on Linux, you may get an error
message indicating that the include file if_tr.h could not be found.
If this happens, go into includes/cf/linux.h and delete the line that
defined HAVE_TR_SUPPORT, or look into installing a new version of libc
that includes the if_tr.h file. We will be working on removing this
problem in the future, but for now, if you run into it, this should be
a viable workaround.
LINUX: SO_ATTACH_FILTER UNDECLARED
In addition, there is a minor issue that we will mention here because
......@@ -434,6 +424,12 @@ running a version of FreeBSD prior to 2.2, and you find that dhcpd
can't communicate with its clients, you should #define BROKEN_FREEBSD_BPF
in site.h and recompile.
Modern versions of FreeBSD include the ISC DHCP 3.0 client as part of
the base system, and the full distribution (for the DHCP server and
relay agent) is available from the Ports Collection in
/usr/ports/net/isc-dhcp3, or as a package on FreeBSD installation
CDROMs.
NeXTSTEP
The NeXTSTEP support uses the NeXTSTEP Berkeley Packet Filter
......@@ -469,22 +465,46 @@ rather than using the ISC DHCP client. The feature set of the Solaris
client is different (not necessarily better or worse) than that of the
ISC client, but in most cases it will be a lot easier for you to just
use that. Please do not ask for help in using the Solaris DHCP client
on Internet Software Consortium mailing lists - that's why you're
on Internet Systems Consortium mailing lists - that's why you're
paying Sun the big bucks. If you're having a problem with the
Solaris client interoperating with the ISC dhcp server, that's another
matter, but please check with Sun first.
AIX
The AIX support uses the BSD socket API, which cannot differentiate on
which network interface a broadcast packet was received; thus the DHCP
server and relay will work only on a single interface. (They do work
on multi-interface machines if configured to listen on only one of the
interfaces.)
The ISC DHCP distribution does not include a dhclient-script for AIX--
AIX comes with a DHCP client. Contribution of a working dhclient-script
for AIX would be welcome.
SUPPORT
The Internet Software Consortium DHCP server is not a commercial
product, and is not supported by the ISC. However, it has attracted a
fairly sizable following on the Internet, which means that there are a
lot of knowledgable users who may be able to help you if you get
stuck. These people generally read the dhcp-server@isc.org mailing
list.
The Internet Systems Consortium DHCP server is developed and distributed
by ISC in the public trust, thanks to the generous donations of its
sponsors. ISC now also fofers commercial quality support contracts for
ISC DHCP, more information about ISC Support Contracts can be found at
the following URL:
http://www.isc.org/ops/support/
No donators, as yet, have asked for their dollars to be spent providing
free support to all who ask. Please understand that we may not respond
to support inquiries unless you have a support contract. ISC will
continue its practice of always responding to critical items that effect
the entire community.
However, ISC DHCP has attracted a fairly sizable following on the
Internet, which means that there are a lot of knowledgable users who
may be able to help you if you get stuck. These people generally read
the dhcp-server@isc.org mailing list.
If you are going to use dhcpd, you should probably subscribe to the
dhcp-server and dhcp-announce mailing lists. If you will be using
dhcp-server or dhcp-announce mailing lists. If you will be using
dhclient, you should subscribe to the dhcp-client mailing list.
If you need help, you should ask on the dhcp-server or dhcp-client
......@@ -495,6 +515,12 @@ If you are having trouble with a combination of the client and server,
send the request to dhcp-server@isc.org. Please do not cross-post to
both lists under any circumstances.
WHERE TO SEND FEATURE REQUESTS: We like to hear your feedback. We may
not respond to it all the time, but we do read it. If ISC DHCP doesn't
work well for you, or you have an idea that would improve it for your
use, please send your suggestion to dhcp-suggest@isc.org. This is also
an excellent place to send patches that add new features.
WHERE TO REPORT BUGS: If you want the act of sending in a bug report
to result in you getting help in the form of a fixed piece of
software, you are asking for help. Your bug report is helpful to us,
......@@ -502,7 +528,7 @@ but fundamentally you are making a support request, so please use the
addresses described in the previous paragraphs. If you are _sure_ that
your problem is a bug, and not user error, or if your bug report
includes a patch, you can send it to dhcp-bugs@isc.org without
subscribing. This mailing list goes into a bug tracking system, so
subscribing. This e-mail address goes into a bug tracking system, so
you don't need to check periodically to see if we still remember the
bug - if you haven't been notified that the bug has been closed, we
still consider it a bug, and still have it in the system.
......@@ -511,8 +537,9 @@ PLEASE DO NOT REPORT BUGS IN OLD SOFTWARE RELEASES! Fetch the latest
release and see if the bug is still in that version of the software,
and if it's not, _then_ report it. It's okay to report bugs in the
latest patchlevel of a major version that's not the most recent major
version, though - for example, if you're running 2.0, you don't have
to upgrade to 3.0 before you can report bugs.
version, though - for example, if you're running 3.0.2, you don't have
to upgrade to a 3.0.3rc (release candidate) or even a 3.1.x release
before you can report bugs.
PLEASE DO NOT REPORT BUGS IF YOU ARE RUNNING A VERSION OF THE ISC
DHCP DISTRIBUTION THAT YOU DIDN'T GET FROM THE ISC! Free operating
......@@ -642,7 +669,6 @@ If you are having problems with a client whose executable is called
dhcpcd, this is _not_ the ISC DHCP client, and we probably can't help
you with it.
Please see http://www.isc.org/services/public/lists/dhcp-lists.html
for details on how to subscribe to the ISC DHCP mailing lists.
Please see http://www.isc.org/sw/dhcp/ for details on how to subscribe
to the ISC DHCP mailing lists.
This diff is collapsed.
# Makefile.dist
#
# Copyright (c) 1996-1999 Internet Software Consortium.
# Use is subject to license terms which appear in the file named
# ISC-LICENSE that should have accompanied this file when you
# received it. If a file named ISC-LICENSE did not accompany this
# file, or you are not sure the one you have is correct, you may
# obtain an applicable copy of the license at:
# Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
# Copyright (c) 1996-2003 by Internet Software Consortium
#
# http://www.isc.org/isc-license-1.0.html.
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# This file is part of the ISC DHCP distribution. The documentation
# associated with this file is listed in the file DOCUMENTATION,
# included in the top-level directory of this release.
#
# Support and other services are available for ISC products - see
# http://www.isc.org for more information.
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# Internet Systems Consortium, Inc.
# 950 Charter Street
# Redwood City, CA 94063
# <info@isc.org>
# http://www.isc.org/
CATMANPAGES = dhclient.cat8 dhclient.conf.cat5 dhclient-script.cat8 \
dhclient.leases.cat5
......
......@@ -3,39 +3,30 @@
Parser for dhclient config and lease files... */
/*
* Copyright (c) 1996-2001 Internet Software Consortium.
* All rights reserved.
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of The Internet Software Consortium nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* Internet Systems Consortium, Inc.
* 950 Charter Street
* Redwood City, CA 94063
* <info@isc.org>
* http://www.isc.org/
*
* This software has been written for the Internet Software Consortium
* This software has been written for Internet Systems Consortium
* by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
* To learn more about the Internet Software Consortium, see
* To learn more about Internet Systems Consortium, see
* ``http://www.isc.org/''. To learn more about Vixie Enterprises,
* see ``http://www.vix.com''. To learn more about Nominum, Inc., see
* ``http://www.nominum.com''.
......@@ -43,7 +34,7 @@
#ifndef lint
static char copyright[] =
"$Id: clparse.c,v 1.63 2001/06/27 00:29:27 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: clparse.c,v 1.64 2005/03/17 20:14:55 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
......@@ -92,6 +83,7 @@ isc_result_t read_client_conf ()
top_level_config.script_name = path_dhclient_script;
top_level_config.requested_options = default_requested_options;
top_level_config.omapi_port = -1;
top_level_config.do_forward_update = 1;
group_allocate (&top_level_config.on_receipt, MDL);
if (!top_level_config.on_receipt)
......@@ -460,6 +452,23 @@ void parse_client_statement (cfile, ip, config)
parse_semi (cfile);
return;
case DO_FORWARD_UPDATE:
token = next_token (&val, (unsigned *)0, cfile);
token = next_token (&val, (unsigned *)0, cfile);
if (!strcasecmp (val, "on") ||
!strcasecmp (val, "true"))
config -> do_forward_update = 1;
else if (!strcasecmp (val, "off") ||
!strcasecmp (val, "false"))
config -> do_forward_update = 0;
else {
parse_warn (cfile, "expecting boolean value.");
skip_to_semi (cfile);
return;
}
parse_semi (cfile);
return;
case REBOOT:
token = next_token (&val, (unsigned *)0, cfile);
parse_lease_time (cfile, &config -> reboot_timeout);
......@@ -599,34 +608,41 @@ void parse_option_list (cfile, list)
struct parse *cfile;
u_int32_t **list;
{
int ix, i;
int ix;
int token;
const char *val;
pair p = (pair)0, q, r;
pair p = (pair)0, q = (pair)0, r;
struct option *option;
ix = 0;
do {
token = next_token (&val, (unsigned *)0, cfile);
if (token == SEMI)
token = peek_token (&val, (unsigned *)0, cfile);
if (token == SEMI) {
token = next_token (&val, (unsigned *)0, cfile);
break;
}
if (!is_identifier (token)) {
parse_warn (cfile, "%s: expected option name.", val);
token = next_token (&val, (unsigned *)0, cfile);
skip_to_semi (cfile);
return;
}
for (i = 0; i < 256; i++) {
if (!strcasecmp (dhcp_options [i].name, val))
break;
}
if (i == 256) {
option = parse_option_name (cfile, 0, NULL);
if (!option) {
parse_warn (cfile, "%s: expected option name.", val);
return;
}
if (option -> universe != &dhcp_universe) {
parse_warn (cfile,
"%s.%s: Only global options allowed.",
option -> universe -> name, option->name );
skip_to_semi (cfile);
return;
}
r = new_pair (MDL);
if (!r)
log_fatal ("can't allocate pair for option code.");
r -> car = (caddr_t)(long)i;
r -> car = (caddr_t)(long)option -> code;
r -> cdr = (pair)0;
if (p)
q -> cdr = r;
......@@ -755,9 +771,7 @@ int interface_or_dummy (struct interface_info **pi, const char *name)
/* If we didn't find an interface, make a dummy interface as
a placeholder. */
if (!ip) {
isc_result_t status;
status = interface_allocate (&ip, MDL);
if (status != ISC_R_SUCCESS)
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);
......@@ -770,6 +784,8 @@ int interface_or_dummy (struct interface_info **pi, const char *name)
}
if (pi)
status = interface_reference (pi, ip, MDL);
else
status = ISC_R_FAILURE;
interface_dereference (&ip, MDL);
if (status != ISC_R_SUCCESS)
return 0;
......@@ -814,7 +830,7 @@ void parse_client_lease_statement (cfile, is_static)
struct parse *cfile;
int is_static;
{
struct client_lease *lease, *lp, *pl;
struct client_lease *lease, *lp, *pl, *next;
struct interface_info *ip = (struct interface_info *)0;
int token;
const char *val;
......@@ -874,17 +890,19 @@ void parse_client_lease_statement (cfile, is_static)
lease list looking for a lease with the same address, and
if we find it, toss it. */
pl = (struct client_lease *)0;
for (lp = client -> leases; lp; lp = lp -> next) {
for (lp = client -> leases; lp; lp = next) {
next = lp -> next;
if (lp -> address.len == lease -> address.len &&
!memcmp (lp -> address.iabuf, lease -> address.iabuf,
lease -> address.len)) {
if (pl)
pl -> next = lp -> next;
pl -> next = next;
else
client -> leases = lp -> next;
client -> leases = next;
destroy_client_lease (lp);
break;
}
} else
pl = lp;
}