Commit 35c16ad3 authored by Michael Gilbert's avatar Michael Gilbert

import upstream 4.3.3

parent d45c7a3f
......@@ -22,10 +22,10 @@ EXTRA_DIST = RELNOTES LICENSE \
doc/devel/arch.dox doc/devel/atf.dox doc/devel/contrib.dox \
doc/devel/debug.dox doc/devel/isc-logo.jpg doc/devel/mainpage.dox \
doc/devel/omapi.dox doc/devel/qa.dox util/bindvar.sh \
bind/Makefile bind/bind.tar.gz bind/version.tmp \
bind/Makefile.in bind/bind.tar.gz bind/version.tmp \
common/tests/Atffile server/tests/Atffile
SUBDIRS = bind includes tests common dst omapip client dhcpctl relay server
SUBDIRS = bind includes tests common omapip client dhcpctl relay server
nobase_include_HEADERS = dhcpctl/dhcpctl.h
Internet Systems Consortium DHCP Distribution
Version 4.3.2
05 March 2015
Version 4.3.3
03 September 2015
README FILE
......@@ -38,6 +38,7 @@ the ISC DHCP Distribution.
5.8.3 Other Solaris Items
5.9 AIX
5.10 MacOS X
5.11 ATF
6 SUPPORT
6.1 HOW TO REPORT BUGS
7 HISTORY
......@@ -141,12 +142,12 @@ 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:
gunzip dhcp-4.3.2.tar.gz
tar xvf dhcp-4.3.2.tar
gunzip dhcp-4.3.3.tar.gz
tar xvf dhcp-4.3.3.tar
CONFIGURING IT
Now, cd to the dhcp-4.3.2 subdirectory that you've just created and
Now, cd to the dhcp-4.3.3 subdirectory that you've just created and
configure the source tree by typing:
./configure
......@@ -585,6 +586,18 @@ recomputed from scratch when the current location/set is changed.
Running the dhclient-script reinstalls the resolv.conf.dhclient6
configuration.
ATF
Please see the file DHCP/doc/devel/atf.dox for a description of building
and using these tools.
The optional unit tests use ATF (Automated Testing Framework) including
the atf-run and atf-report tools. ATF deprecated these tools in
version 0.19 and removed these tools from its sources in version 0.20,
requiring you to get an older version, use Kyua with an ATF compatibility
package or use the version included in the Bind sources.
SUPPORT
The Internet Systems Consortium DHCP server is developed and distributed
......
This diff is collapsed.
/* dhc6.c - DHCPv6 client routines. */
/*
* Copyright (c) 2012-2014 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2012-2015 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2006-2010 by Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and distribute this software for any
......@@ -2798,6 +2798,12 @@ init_handler(struct packet *packet, struct client_state *client)
lease = dhc6_leaseify(packet);
/* Out of memory or corrupt packet condition...hopefully a temporary
* problem. Returning now makes us try to retransmit later.
*/
if (lease == NULL)
return;
if (dhc6_check_advertise(lease) != ISC_R_SUCCESS) {
log_debug("PRC: Lease failed to satisfy.");
dhc6_lease_destroy(&lease, MDL);
......@@ -2915,7 +2921,7 @@ rapid_commit_handler(struct packet *packet, struct client_state *client)
lease = dhc6_leaseify(packet);
/* This is an out of memory condition...hopefully a temporary
/* Out of memory or corrupt packet condition...hopefully a temporary
* problem. Returning now makes us try to retransmit later.
*/
if (lease == NULL)
......@@ -3729,7 +3735,7 @@ reply_handler(struct packet *packet, struct client_state *client)
lease = dhc6_leaseify(packet);
/* This is an out of memory condition...hopefully a temporary
/* Out of memory or corrupt packet condition...hopefully a temporary
* problem. Returning now makes us try to retransmit later.
*/
if (lease == NULL)
......@@ -4259,6 +4265,10 @@ start_bound(struct client_state *client)
oldia = NULL;
for (addr = ia->addrs ; addr != NULL ; addr = addr->next) {
/* Don't try to use the address if it's already expired */
if (addr->flags & DHC6_ADDR_EXPIRED)
continue;
if (oldia != NULL) {
if (ia->ia_type != D6O_IA_PD)
oldaddr = find_addr(oldia->addrs,
......
.\" $Id: dhclient.8,v 1.36 2011/04/15 21:58:12 sar Exp $
.\"
.\" Copyright (c) 2004,2007-2014 by Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (c) 2004,2007-2015 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
......@@ -427,8 +427,33 @@ Path to the network configuration script invoked by
when it gets a lease. If unspecified, the default
.B CLIENTBINDIR/dhclient-script
is used. See \fBdhclient-script(8)\fR for a description of this file.
.PP
.SH PORTS
During operations the client may use multiple UDP ports
to provide different functions. Which ports are opened depends
on both the way you compiled your code and the configuration you
supply. The following should provide you an idea of what
ports may be in use.
Normally a DHCPv4 client will open a raw UDP socket to receive
and send most DHCPv4 packets. It also opens a fallback UDP socket
for use in sending unicast packets. Normally these will both
use the well known port number for BOOTPC.
For DHCPv6 the client opens a UDP socket on the well known
client port and a fallback UDP socket on a random port for
use in sending unicast messages. Unlike DHCPv4 the well
known socket doesn't need to be opened in raw mode.
If you have included an omapi port statement in your configuration
file then the client will open a TCP socket on that port to
listen for OMPAI connections. When something connects another
port will be used for the established connection.
When DDNS is enabled at compile time (see includes/site.h)
the client will open both a v4 and a v6 UDP socket on
random ports. These ports are opened even if DDNS is disabled
in the configuration file.
.PP
.SH CONFIGURATION
The syntax of the \fBdhclient.conf(5)\fR file is discussed separately.
......
......@@ -101,6 +101,9 @@ static int check_domain_name_list(const char *ptr, size_t len, int dots);
static int check_option_values(struct universe *universe, unsigned int opt,
const char *ptr, size_t len);
static void dhclient_ddns_cb_free(dhcp_ddns_cb_t *ddns_cb,
char* file, int line);
#ifndef UNIT_TEST
int
main(int argc, char **argv) {
......@@ -867,11 +870,9 @@ void classify (packet, class)
{
}
int unbill_class (lease, class)
void unbill_class (lease)
struct lease *lease;
struct class *class;
{
return 0;
}
int find_subnet (struct subnet **sp,
......@@ -1241,7 +1242,7 @@ void bind_lease (client)
/* Run the client script with the new parameters. */
script_init(client, (client->state == S_REQUESTING ? "BOUND" :
(client->state == S_RENEWING ? "RENEW" :
(client->state == S_RENEWING ? "RENEW" :
(client->state == S_REBOOTING ? "REBOOT" :
"REBIND"))),
client->new->medium);
......@@ -1694,7 +1695,7 @@ struct client_lease *packet_to_lease (packet, client)
lease->next_srv_addr.len = sizeof(packet->raw->siaddr);
memcpy(lease->next_srv_addr.iabuf, &packet->raw->siaddr,
lease->next_srv_addr.len);
memset(&data, 0, sizeof(data));
if (client -> config -> vendor_space_name) {
......@@ -2448,7 +2449,7 @@ make_client_options(struct client_state *client, struct client_lease *lease,
/* Client-identifier type : 1 byte */
*client_identifier.buffer->data = 255;
/* IAID : 4 bytes
* we use the low 4 bytes from the interface address
*/
......@@ -2462,7 +2463,7 @@ make_client_options(struct client_state *client, struct client_lease *lease,
memcpy(&client_identifier.buffer->data + 5 - hw_len,
client->interface->hw_address.hbuf + hw_idx,
hw_len);
/* Add the default duid */
memcpy(&client_identifier.buffer->data+(1+4),
default_duid.data, default_duid.len);
......@@ -3965,7 +3966,7 @@ client_dns_remove_action(dhcp_ddns_cb_t *ddns_cb,
}
/* If we are done or have an error clean up */
ddns_cb_free(ddns_cb, MDL);
dhclient_ddns_cb_free(ddns_cb, MDL);
return;
}
......@@ -3981,7 +3982,7 @@ client_dns_remove(struct client_state *client,
ddns_cancel(client->ddns_cb, MDL);
client->ddns_cb = NULL;
}
ddns_cb = ddns_cb_alloc(MDL);
if (ddns_cb != NULL) {
ddns_cb->address = *addr;
......@@ -3994,7 +3995,7 @@ client_dns_remove(struct client_state *client,
result = client_dns_update(client, ddns_cb);
if (result != ISC_R_TIMEDOUT) {
ddns_cb_free(ddns_cb, MDL);
dhclient_ddns_cb_free(ddns_cb, MDL);
}
}
}
......@@ -4091,10 +4092,7 @@ client_dns_update_timeout (void *cp)
* the control block and should free it.
*/
if (status != ISC_R_TIMEDOUT) {
if (client != NULL) {
client->ddns_cb = NULL;
}
ddns_cb_free(ddns_cb, MDL);
dhclient_ddns_cb_free(ddns_cb, MDL);
}
}
......@@ -4183,7 +4181,7 @@ client_dns_update_action(dhcp_ddns_cb_t *ddns_cb,
return;
}
ddns_cb_free(ddns_cb, MDL);
dhclient_ddns_cb_free(ddns_cb, MDL);
return;
}
......@@ -4263,7 +4261,7 @@ client_dns_update(struct client_state *client, dhcp_ddns_cb_t *ddns_cb)
}
if (client->active_lease != NULL) {
/* V6 request, get the client identifier, then
* construct the dhcid for either standard
* construct the dhcid for either standard
* or interim */
if (((oc = lookup_option(&dhcpv6_universe,
client->sent_options,
......@@ -4380,7 +4378,6 @@ dhclient_schedule_updates(struct client_state *client,
ddns_cb->flags = DDNS_UPDATE_ADDR | DDNS_INCLUDE_RRSET;
client->ddns_cb = ddns_cb;
tv.tv_sec = cur_tv.tv_sec + offset;
tv.tv_usec = cur_tv.tv_usec;
add_timeout(&tv, client_dns_update_timeout,
......@@ -4560,7 +4557,7 @@ static int check_option_values(struct universe *universe,
static void
add_reject(struct packet *packet) {
struct iaddrmatchlist *list;
list = dmalloc(sizeof(struct iaddrmatchlist), MDL);
if (!list)
log_fatal ("no memory for reject list!");
......@@ -4585,3 +4582,16 @@ add_reject(struct packet *packet) {
log_info("Server added to list of rejected servers.");
}
/* Wrapper function around common ddns_cb_free function that ensures
* we set the client_state pointer to the control block to NULL. */
static void
dhclient_ddns_cb_free(dhcp_ddns_cb_t *ddns_cb, char* file, int line) {
if (ddns_cb) {
struct client_state *client = (struct client_state *)ddns_cb->lease;
if (client != NULL) {
client->ddns_cb = NULL;
}
ddns_cb_free(ddns_cb, file, line);
}
}
......@@ -3,7 +3,7 @@
Lexical scanner for dhcpd config file... */
/*
* Copyright (c) 2004-2014 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2015 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
......@@ -147,13 +147,21 @@ save_parse_state(struct parse *cfile) {
/*
* Return the parser to the previous saved state.
*
* You must call save_parse_state() before calling
* restore_parse_state(), but you can call restore_parse_state() any
* number of times after that.
* You must call save_parse_state() every time before calling
* restore_parse_state().
*
* Note: When the read function callback is in use in ldap mode,
* a call to get_char() may reallocate the buffer and will append
* config data to the buffer until a state restore.
* Do not restore to the (freed) pointer and size, but use new one.
*/
isc_result_t
restore_parse_state(struct parse *cfile) {
struct parse *saved_state;
#if defined(LDAP_CONFIGURATION)
char *inbuf = cfile->inbuf;
size_t size = cfile->bufsiz;
#endif
if (cfile->saved_state == NULL) {
return DHCP_R_NOTYET;
......@@ -161,7 +169,13 @@ restore_parse_state(struct parse *cfile) {
saved_state = cfile->saved_state;
memcpy(cfile, saved_state, sizeof(*cfile));
cfile->saved_state = saved_state;
dfree(saved_state, MDL);
cfile->saved_state = NULL;
#if defined(LDAP_CONFIGURATION)
cfile->inbuf = inbuf;
cfile->bufsiz = size;
#endif
return ISC_R_SUCCESS;
}
......@@ -476,6 +490,8 @@ read_whitespace(int c, struct parse *cfile) {
}
cfile->tokbuf[ofs++] = c;
c = get_char(cfile);
if (c == EOF)
return END_OF_FILE;
} while (!((c == '\n') && cfile->eol_token) &&
isascii(c) && isspace(c));
......@@ -1214,6 +1230,8 @@ intern(char *atom, enum dhcp_token dfv) {
return OWNER;
break;
case 'p':
if (!strcasecmp (atom + 1, "arse-vendor-option"))
return PARSE_VENDOR_OPT;
if (!strcasecmp (atom + 1, "repend"))
return PREPEND;
if (!strcasecmp(atom + 1, "referred-life"))
......
.\" $Id: dhcp-eval.5,v 1.33 2012/05/17 15:50:14 sar Exp $
.\"
.\" Copyright (c) 2009-2012,2014 by Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (c) 2009-2012,2014-2015 by Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (c) 2004,2007 by Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (c) 1996-2003 by Internet Software Consortium
.\"
......@@ -557,6 +557,21 @@ It is possible to use the execute statement in any context, not only
on events. If you put it in a regular scope in the configuration file
you will execute that command every time a scope is evaluated.
.RE
.PP
.B parse-vendor-option;\fR
.RS 0.25i
.PP
The \fBparse-vendor-option\fR statement attempts to parse a vendor
option (code 43). It is only useful while processing a packet on the server
and requires that the administrator has already used the
\fBvendor-option-space\fR statement to select a valid vendor space.
.PP
This functionality may be used if the server needs to take different
actions depending on the values the client placed in the vendor option
and the sub-options are not at fixed locations. It is handled as an
action to allow an administrator to examine the incoming options and
choose the correct vendor space.
.RE
.SH REFERENCE: DYNAMIC DNS UPDATES
.PP
See the dhcpd.conf and dhclient.conf man pages for more information
......
.\" $Id: dhcp-options.5,v 1.50 2011/05/20 13:48:32 tomasz Exp $
.\"
.\" Copyright (c) 2012-2014 by Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (c) 2012-2015 by Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (c) 1996-2003 by Internet Software Consortium
.\"
......@@ -771,7 +771,7 @@ preference.
\fIip-address\fR... ]\fB;\fR
.RS 0.25i
.PP
The NNTP server option specifies a list of NNTP servesr available
The NNTP server option specifies a list of NNTP servers available
to the client. Servers should be listed in order of preference.
.RE
.PP
......@@ -814,7 +814,7 @@ information.
.I ip-address \fR...]\fB;\fR
.RS 0.25i
.PP
This option contains infomration about the rapid deployment option. It is
This option contains information about the rapid deployment option. It is
8 bits of ipv4 mask length, 8 bits of 6rd prefix length, an ipv6 prefix as
an ipv6 address and a list of one or more ipv4 addresses.
.PP
......@@ -896,8 +896,8 @@ to the client. Servers should be listed in order of preference.
.RS 0.25i
.PP
The rdnss-selection option specifies an 8 bit flags field, a primary and secondary
ip address for the name server and a domainlist of domains for whcih the RDNSS has
sepcial knowledge.
ip address for the name server and a domainlist of domains for which the RDNSS has
special knowledge.
.PP
This option is included based on RFC 6731.
.RE
......@@ -1556,11 +1556,14 @@ software, and is not meant for user configuration.
.RS 0.25i
.PP
The \fBunicast\fR option is provided by DHCPv6 servers which are
willing (or prefer) to receive Renew packets from their clients
by exchanging UDP unicasts with them. Normally, DHCPv6 clients
will multicast their Renew messages. This may be configured on
the server, and should be configured as an address the server
is ready to reply to.
willing (or prefer) to receive Request, Renew, Decline, and Release packets
from their clients via unicast. Normally, DHCPv6 clients will multicast
these messages. Per RFC 3315, the server will reject a unicast message received
from a client unless it previously sent (or would have sent) the unicast option
to that client. This option may be configured on the server at the global and
shared network level. When a unicast message is received, the server will
check for an applicable definition of the unicast option. If such an option
is found the message will be accepted, if not it will be rejected.
.RE
.PP
.B option \fBdhcp6.status-code\fR \fIstatus-code\fR [ \fIstring\fR ] \fB;\fR
......@@ -1615,7 +1618,7 @@ informationally only.
.RS 0.25i
.PP
The \fBreconf-accept\fR option is included by DHCPv6 clients that
support the Reconfigure extentions, advertising that they will
support the Reconfigure extensions, advertising that they will
respond if the server were to ask them to Reconfigure. There is
no support for DHCPv6 Reconfigure extensions, and this option is
documented informationally only.
......
......@@ -3,7 +3,7 @@
Domain Name Service subroutines. */
/*
* Copyright (c) 2009-2014 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2009-2015 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2001-2003 by Internet Software Consortium
*
......
......@@ -3,7 +3,7 @@
Support for executable statements. */
/*
* Copyright (c) 2009,2013,2014 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2009,2013-2015 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1998-2003 by Internet Software Consortium
*
......@@ -531,6 +531,14 @@ int execute_statements (result, packet, lease, client_state,
break;
case vendor_opt_statement:
/* If possible parse any options in a vendor option
* encapsulation, this may add options to the in_options
* option state */
parse_vendor_option(packet, lease, client_state,
in_options, out_options, scope);
break;
default:
log_error ("bogus statement type %d", r -> op);
break;
......@@ -1000,6 +1008,11 @@ void write_statements (file, statements, indent)
#endif /* ENABLE_EXECUTE */
break;
case vendor_opt_statement:
indent_spaces (file, indent);
fprintf (file, "parse-vendor-option;");
break;
default:
log_fatal ("bogus statement type %d\n", r -> op);
}
......@@ -1161,7 +1174,8 @@ int executable_statement_foreach (struct executable_statement *stmt,
break;
case log_statement:
case return_statement:
case execute_statement:
case execute_statement:
case vendor_opt_statement:
break;
}
}
......
......@@ -368,17 +368,30 @@ ssize_t receive_packet (interface, buf, len, from, hfrom)
unsigned char ibuf [1536];
unsigned bufix = 0;
unsigned paylen;
unsigned char cmsgbuf[CMSG_LEN(sizeof(struct tpacket_auxdata))];
struct iovec iov = {
.iov_base = ibuf,
.iov_len = sizeof ibuf,
};
#ifdef PACKET_AUXDATA
/*
* We only need cmsgbuf if we are getting the aux data and we
* only get the auxdata if it is actually defined
*/
unsigned char cmsgbuf[CMSG_LEN(sizeof(struct tpacket_auxdata))];
struct msghdr msg = {
.msg_iov = &iov,
.msg_iovlen = 1,
.msg_control = cmsgbuf,
.msg_controllen = sizeof(cmsgbuf),
};
#else
struct msghdr msg = {
.msg_iov = &iov,
.msg_iovlen = 1,
.msg_control = NULL,
.msg_controllen = 0,
};
#endif /* PACKET_AUXDATA */
length = recvmsg (interface->rfdesc, &msg, 0);
if (length <= 0)
......@@ -422,7 +435,7 @@ ssize_t receive_packet (interface, buf, len, from, hfrom)
}
}
#endif
#endif /* PACKET_AUXDATA */
bufix = 0;
/* Decode the physical header... */
......
......@@ -3,7 +3,7 @@
DHCP options parsing and reassembly. */
/*
* Copyright (c) 2004-2012,2014 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2012,2014-2015 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
......@@ -4285,3 +4285,96 @@ int validate_packet(struct packet *packet)
return (1);
}
/*!
*
* \brief Parse a vendor option (option 43)
*
* After the server has parsed most of the options and presented the result
* to the user the user can set the proper vendor option space using
* vendor-option-space in the config file and then cause this routine to be
* called via parse-vendor-option in the config file. This routine will
* then try and find the proper universe for the vendor-option-space and
* parse the vendor option string based on that universe.
*
* If the information isn't available (no vendor space, no universe for the
* vendor space, no vendor option in the options) or the decode fails we
* simply ignore the option and continue processing.
*
* \param packet - structure to hold information about the packet being
* processed
* \param lease - lease structure
* \param client_state
* \param in_options - The incoming options, we expect to find the
* vendor-option (option 43, containing the string
* to parse) there. We shall attach decoded options
* there.
* \param out_options - The options we have added as we process the packet.
* We expect to find the vendor-option-space there and
* use that to find the name of the vendor universe to use
* \param scope
*
* \return - void as there isn't much we can do about failures.
*/
void parse_vendor_option(packet, lease, client_state, in_options,
out_options, scope)
struct packet *packet;
struct lease *lease;
struct client_state *client_state;
struct option_state *in_options;
struct option_state *out_options;
struct binding_scope **scope;
{
struct option_cache *oc = NULL;
struct data_string name;
struct option *option = NULL;
unsigned int code = DHO_VENDOR_ENCAPSULATED_OPTIONS;
/* check if we are processing a packet, if not we can return */
if ((packet == NULL) || (in_options == NULL) || (out_options == NULL))
return;
/* Do we have any vendor option spaces? */
if (vendor_cfg_option == NULL)
return;
/* See if the admin has set a vendor option space name */
oc = lookup_option(vendor_cfg_option->universe,
out_options, vendor_cfg_option->code);
if (oc == NULL)
return;
memset(&name, 0, sizeof(name));
evaluate_option_cache(&name, packet, lease, client_state,
in_options, out_options, scope, oc, MDL);
/* No name, all done */
if (name.len == 0)
return;
/* Get any vendor option information from the request */
oc = lookup_option(&dhcp_universe, in_options, code);
/* No vendor option, all done */
if ((oc == NULL) || (oc->data.len == 0)) {
data_string_forget(&name, MDL);
return;
}
/* Get the proper option to pass to the parse routine */
option_code_hash_lookup(&option, dhcp_universe.code_hash,
&code, 0, MDL);
/* Now that we have the data from the vendor option and a vendor
* option space try to parse things. On success the parsed options
* will be added to the in_options list for future use. A return
* return of 1 indicates success, but not much we can do on error */
(void) parse_encapsulated_suboptions(in_options, option,
oc->data.data, oc->data.len,
&dhcp_universe,
(const char *)name.data);
/* Lastly clean up any left overs */
data_string_forget(&name, MDL);
option_dereference(&option, MDL);
return;
}
......@@ -3,7 +3,7 @@
Common parser code for dhcpd and dhclient. */
/*
* Copyright (c) 2004-2014 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 2004-2015 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
......@@ -384,10 +384,11 @@ parse_ip6_addr(struct parse *cfile, struct iaddr *addr) {
*/
v6_len = 0;
for (;;) {
if ((((token == NAME) || (token == NUMBER_OR_NAME)) &&
if ((((token == NAME) || (token == NUMBER_OR_NAME)) &&
is_hex_string(val)) ||
(token == NUMBER) ||
(token == DOT) ||
(token == NUMBER) ||
(token == TOKEN_ADD) ||
(token == DOT) ||
(token == COLON)) {
next_raw_token(&val, NULL, cfile);
......@@ -1108,6 +1109,13 @@ parse_date_core(cfile)
return((TIME)0);
}
/* If the year is 2038 or greater return the max time to avoid
* overflow issues. We could try and be more precise but there
* doesn't seem to be a good reason to worry about it and waste
* the cpu looking at the rest of the date. */
if (year >= 138)
return(MAX_TIME);
/* Guess the time value... */
guess = ((((((365 * (year - 70) + /* Days in years since '70 */
(year - 69) / 4 + /* Leap days since '70 */
......@@ -2632,6 +2640,22 @@ int parse_executable_statement (result, cfile, lose, case_context)
}
break;
case PARSE_VENDOR_OPT:
/* The parse-vendor-option; The statement has no arguments.
* We simply set up the statement and when it gets executed it
* will find all information it needs in the packet and options.
*/
skip_token(&val, NULL, cfile);
if (!parse_semi(cfile)) {
*lose = 1;
return (0);
}
if (!executable_statement_allocate(result, MDL))
log_fatal("no memory for execute statement.");
(*result)->op = vendor_opt_statement;
break;
/* Not really a statement, but we parse it here anyway
because it's appropriate for all DHCP agents with
parsers. */
......
AC_INIT([DHCP],[4.3.2],[dhcp-users@isc.org])
AC_INIT([DHCP],[4.3.3],[dhcp-users@isc.org])
# we specify "foreign" to avoid having to have the GNU mandated files,
# like AUTHORS, COPYING, and such
......@@ -32,6 +32,10 @@ if test "$GCC" = "yes"; then
fi
fi
# We can have some flags to pass to bind configure
BINDCONFIG=
AC_SUBST(BINDCONFIG)
# POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
# parts of the IPv6 Advanced Socket API as a result. This is stupid
# as it breaks how the two halves (Basic and Advanced) of the IPv6
......@@ -183,13 +187,33 @@ if test "$enable_log_pid" = "yes" ; then
[Define to include PIDs in syslog messages.])
fi
# Allow for binary search when inserting v4 leases into queues
AC_ARG_ENABLE(binary_leases,
AS_HELP_STRING([--enable-binary-leases],[enable support for binary insertion of leases (default is no)]))
# binary_leases is off by default.
if test "$enable_binary_leases" = "yes"; then
AC_DEFINE([BINARY_LEASES], [1],
[Define to support binary insertion of leases into queues.])
fi
# Testing section
atf_path="no"