Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/usr.sbin/dhcp Pull up revision 1.1.1.4 (requested by me...
details: https://anonhg.NetBSD.org/src/rev/bf44cb0d5627
branches: netbsd-1-5
changeset: 491096:bf44cb0d5627
user: he <he%NetBSD.org@localhost>
date: Wed Apr 04 20:55:47 2001 +0000
description:
Pull up revision 1.1.1.4 (requested by mellon):
Update DHCP software to ISC version 3, Beta 2, Patchlevel 23.
diffstat:
usr.sbin/dhcp/client/scripts/openbsd | 18 +-
usr.sbin/dhcp/common/dhcp-eval.5 | 100 +++++++++-
usr.sbin/dhcp/common/resolv.c | 15 +-
usr.sbin/dhcp/dhcpctl/remote.c | 24 ++-
usr.sbin/dhcp/omapip/buffer.c | 178 ++++++++++++++++++++-
usr.sbin/dhcp/omapip/listener.c | 298 ++++++++++++++++++++++++----------
usr.sbin/dhcp/server/dhcpd.conf | 80 ++++++--
7 files changed, 564 insertions(+), 149 deletions(-)
diffs (truncated from 1004 to 300 lines):
diff -r b6b78ace23b8 -r bf44cb0d5627 usr.sbin/dhcp/client/scripts/openbsd
--- a/usr.sbin/dhcp/client/scripts/openbsd Wed Apr 04 20:55:43 2001 +0000
+++ b/usr.sbin/dhcp/client/scripts/openbsd Wed Apr 04 20:55:47 2001 +0000
@@ -50,8 +50,8 @@
fi
if [ x$reason = xMEDIUM ]; then
- ifconfig $interface $medium
- ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1
+ eval "ifconfig $interface $medium"
+ eval "ifconfig $interface inet -alias 0.0.0.0 $medium" >/dev/null 2>&1
sleep 1
exit_with_hooks 0
fi
@@ -88,7 +88,7 @@
fi
if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]
then
- ifconfig $interface inet -alias $old_ip_address $medium
+ eval "ifconfig $interface inet -alias $old_ip_address $medium"
route delete $old_ip_address 127.1 >/dev/null 2>&1
for router in $old_routers; do
route delete default $router >/dev/null 2>&1
@@ -104,8 +104,8 @@
fi
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
- ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $medium
+ eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
+ $new_broadcast_arg $medium"
route add $new_ip_address 127.1 >/dev/null 2>&1
for router in $new_routers; do
route add default $router >/dev/null 2>&1
@@ -133,7 +133,7 @@
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
if [ x$old_ip_address != x ]; then
- ifconfig $interface inet -alias $old_ip_address $medium
+ eval "ifconfig $interface inet -alias $old_ip_address $medium"
route delete $old_ip_address 127.1 >/dev/null 2>&1
for router in $old_routers; do
route delete default $router >/dev/null 2>&1
@@ -160,8 +160,8 @@
ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
- ifconfig $interface inet $new_ip_address $new_netmask_arg \
- $new_broadcast_arg $medium
+ eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
+ $new_broadcast_arg $medium"
sleep 1
if [ "$new_routers" != "" ]; then
set $new_routers
@@ -184,7 +184,7 @@
exit_with_hooks 0
fi
fi
- ifconfig $interface inet -alias $new_ip_address $medium
+ eval "ifconfig $interface inet -alias $new_ip_address $medium"
for router in $old_routers; do
route delete default $router >/dev/null 2>&1
done
diff -r b6b78ace23b8 -r bf44cb0d5627 usr.sbin/dhcp/common/dhcp-eval.5
--- a/usr.sbin/dhcp/common/dhcp-eval.5 Wed Apr 04 20:55:43 2001 +0000
+++ b/usr.sbin/dhcp/common/dhcp-eval.5 Wed Apr 04 20:55:47 2001 +0000
@@ -1,23 +1,42 @@
.\" dhcp-eval.5
.\"
-.\" 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) 1996-2001 Internet Software Consortium.
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
.\"
-.\" http://www.isc.org/isc-license-1.0.html.
+.\" 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.
.\"
-.\" 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.
+.\" 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.
.\"
-.\" Support and other services are available for ISC products - see
-.\" http://www.isc.org for more information.
-.TH dhcpd-eval 5
+.\" This software has been written for the Internet Software Consortium
+.\" by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
+.\" To learn more about the Internet Software 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''.
+.TH dhcp-eval 5
.SH NAME
-dhcp-conditionals - ISC DHCP conditional evaluation
+dhcp-eval - ISC DHCP conditional evaluation
.SH DESCRIPTION
The Internet Software Consortium DHCP client and server both provide
the ability to perform conditional behavior depending on the contents
@@ -226,7 +245,13 @@
.PP
.RS 0.25i
A string, enclosed in quotes, may be specified as a data expression,
-and returns the text between the quotes, encoded in ASCII.
+and returns the text between the quotes, encoded in ASCII. The
+backslash ('\\') character is treated specially, as in C programming:
+'\\t' means TAB, '\\r' means carriage return, '\\n' means newline, and
+'\\b' means bell. Any octal value can be specified with '\\nnn',
+where nnn is any positive octal number less than 0400. Any
+hexadecimal value can be specified with '\xnn', where nn is any
+positive hexadecimal number less than 0xff.
.RE
.PP
.I colon-seperated hexadecimal list
@@ -339,6 +364,51 @@
Any number between zero and the maximum representable size may be
specified as a numeric expression.
.RE
+.PP
+.B client-state
+.PP
+.RS 0.25i
+The current state of the client instance being processed. This is
+only useful in DHCP client configuration files. Possible values are:
+.TP 2
+.I \(bu
+Booting - DHCP client is in the INIT state, and does not yet have an
+IP address. The next message transmitted will be a DHCPDISCOVER,
+which will be broadcast.
+.TP
+.I \(bu
+Reboot - DHCP client is in the INIT-REBOOT state. It has an IP
+address, but is not yet using it. The next message to be transmitted
+will be a DHCPREQUEST, which will be broadcast. If no response is
+heard, the client will bind to its address and move to the BOUND state.
+.TP
+.I \(bu
+Select - DHCP client is in the SELECTING state - it has received at
+least one DHCPOFFER message, but is waiting to see if it may receive
+other DHCPOFFER messages from other servers. No messages are sent in
+the SELECTING state.
+.TP
+.I \(bu
+Request - DHCP client is in the REQUESTING state - it has received at
+least one DHCPOFFER message, and has chosen which one it will
+request. The next message to be sent will be a DHCPREQUEST message,
+which will be broadcast.
+.TP
+.I \(bu
+Bound - DHCP client is in the BOUND state - it has an IP address. No
+messages are transmitted in this state.
+.TP
+.I \(bu
+Renew - DHCP client is in the RENEWING state - it has an IP address,
+and is trying to contact the server to renew it. The next message to
+be sent will be a DHCPREQUEST message, which will be unicast directly
+to the server.
+.TP
+.I \(bu
+Rebind - DHCP client is in the REBINDING state - it has an IP address,
+and is trying to contact any server to renew it. The next message to
+be sent will be a DHCPREQUEST, which will be broadcast.
+.RE
.SH
FUNCTIONS
Functions may be defined with the \fBdefine\fR statement. A function
diff -r b6b78ace23b8 -r bf44cb0d5627 usr.sbin/dhcp/common/resolv.c
--- a/usr.sbin/dhcp/common/resolv.c Wed Apr 04 20:55:43 2001 +0000
+++ b/usr.sbin/dhcp/common/resolv.c Wed Apr 04 20:55:47 2001 +0000
@@ -3,7 +3,7 @@
Parser for /etc/resolv.conf file. */
/*
- * Copyright (c) 1996-2000 Internet Software Consortium.
+ * Copyright (c) 1996-2001 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
-"$Id: resolv.c,v 1.1.1.3 2000/04/22 07:11:37 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
+"$Id: resolv.c,v 1.1.1.3.4.1 2001/04/04 20:55:47 he Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -74,8 +74,8 @@
cfile -> eol_token = 1;
do {
- token = next_token (&val, cfile);
- if (token == EOF)
+ token = next_token (&val, (unsigned *)0, cfile);
+ if (token == END_OF_FILE)
break;
else if (token == EOL)
continue;
@@ -106,14 +106,15 @@
dn = (char *)0;
}
nd -> rcdate = parse_time;
- token = peek_token (&val, cfile);
+ token = peek_token (&val,
+ (unsigned *)0, cfile);
} while (token != EOL);
if (token != EOL) {
parse_warn (cfile,
"junk after domain declaration");
skip_to_semi (cfile);
}
- token = next_token (&val, cfile);
+ token = next_token (&val, (unsigned *)0, cfile);
} else if (token == NAMESERVER) {
struct name_server *ns, **sp;
struct iaddr iaddr;
@@ -149,7 +150,7 @@
} else
skip_to_semi (cfile); /* Ignore what we don't grok. */
} while (1);
- token = next_token (&val, cfile); /* Clear the peek buffer */
+ token = next_token (&val, (unsigned *)0, cfile);
/* Lose servers that are no longer in /etc/resolv.conf. */
sl = (struct name_server *)0;
diff -r b6b78ace23b8 -r bf44cb0d5627 usr.sbin/dhcp/dhcpctl/remote.c
--- a/usr.sbin/dhcp/dhcpctl/remote.c Wed Apr 04 20:55:43 2001 +0000
+++ b/usr.sbin/dhcp/dhcpctl/remote.c Wed Apr 04 20:55:47 2001 +0000
@@ -74,12 +74,26 @@
}
strcpy (key -> name, name);
- key -> algorithm = dmalloc (strlen (algorithm) + 1, MDL);
- if (!key -> algorithm) {
- omapi_auth_key_dereference (&key, MDL);
- return ISC_R_NOMEMORY;
+ /* If the algorithm name isn't an FQDN, tack on the
+ .SIG-ALG.REG.NET. domain. */
+ if (strchr (algorithm, '.') == 0) {
+ static char add[] = ".SIG-ALG.REG.INT.";
+ key -> algorithm = dmalloc (strlen (algorithm) +
+ sizeof (add), MDL);
+ if (!key -> algorithm) {
+ omapi_auth_key_dereference (&key, MDL);
+ return ISC_R_NOMEMORY;
+ }
+ strcpy (key -> algorithm, algorithm);
+ strcat (key -> algorithm, add);
+ } else {
+ key -> algorithm = dmalloc (strlen (algorithm) + 1, MDL);
+ if (!key -> algorithm) {
+ omapi_auth_key_dereference (&key, MDL);
+ return ISC_R_NOMEMORY;
+ }
+ strcpy (key -> algorithm, algorithm);
}
- strcpy (key -> algorithm, algorithm);
status = omapi_data_string_new (&key -> key, secret_len, MDL);
if (status != ISC_R_SUCCESS) {
diff -r b6b78ace23b8 -r bf44cb0d5627 usr.sbin/dhcp/omapip/buffer.c
--- a/usr.sbin/dhcp/omapip/buffer.c Wed Apr 04 20:55:43 2001 +0000
+++ b/usr.sbin/dhcp/omapip/buffer.c Wed Apr 04 20:55:47 2001 +0000
@@ -3,7 +3,7 @@
Buffer access functions for the object management protocol... */
/*
- * Copyright (c) 1999-2000 Internet Software Consortium.
+ * Copyright (c) 1999-2001 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,18 +43,118 @@
#include <omapip/omapip_p.h>
Home |
Main Index |
Thread Index |
Old Index