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.8 (requested by mellon):
details: https://anonhg.NetBSD.org/src/rev/0560fcc2b66f
branches: netbsd-1-5
changeset: 491089:0560fcc2b66f
user: he <he%NetBSD.org@localhost>
date: Wed Apr 04 20:55:17 2001 +0000
description:
Pull up revision 1.8 (requested by mellon):
Update DHCP software to ISC version 3, Beta 2, Patchlevel 23.
diffstat:
usr.sbin/dhcp/client/dhclient-script.8 | 61 ++++-
usr.sbin/dhcp/common/bpf.c | 32 +-
usr.sbin/dhcp/common/dhcp-options.5 | 78 ++++--
usr.sbin/dhcp/common/tables.c | 350 ++++++++++++++++----------------
4 files changed, 294 insertions(+), 227 deletions(-)
diffs (truncated from 690 to 300 lines):
diff -r e341fafa67f1 -r 0560fcc2b66f usr.sbin/dhcp/client/dhclient-script.8
--- a/usr.sbin/dhcp/client/dhclient-script.8 Wed Apr 04 20:55:12 2001 +0000
+++ b/usr.sbin/dhcp/client/dhclient-script.8 Wed Apr 04 20:55:17 2001 +0000
@@ -1,20 +1,39 @@
.\" dhclient-script.8
.\"
-.\" 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:
+.\"
+.\" 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.
.\"
-.\" http://www.isc.org/isc-license-1.0.html.
+.\" 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.
.\"
-.\" 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.
+.\" 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 dhclient-script 8
.SH NAME
dhclient-script - DHCP client network configuration script
@@ -60,16 +79,22 @@
to change the behaviour of the script. If an error occurs during the
execution of the script, it can set the exit_status variable to a nonzero
value, and
-.B /etc/dhclient-script
+.B /sbin/dhclient-script
will exit with that error code immediately after the client script exits.
.PP
After all processing has completed,
-.B /etc/dhclient-script
+.B /sbin/dhclient-script
checks for the presence of an executable
.B /etc/dhclient-exit-hooks
-script, which if present is invoked using the '.' command. The exit status
-is passed in the exit_status shell variable, and will always be zero if the
-script succeeded at the task for which it was invoked.
+script, which if present is invoked using the '.' command. The exit
+status of dhclient-script will be passed to dhclient-exit-hooks in the
+exit_status shell variable, and will always be zero if the script
+succeeded at the task for which it was invoked. The rest of the
+environment as described previously for dhclient-enter-hooks is also
+present. The
+.B /etc/dhclient-exit-hooks
+script can modify the valid of exit_status to change the exit status
+of dhclient-script.
.SH OPERATION
When dhclient needs to invoke the client configuration script, it
writes a shell script into /tmp which defines a variety of variables.
diff -r e341fafa67f1 -r 0560fcc2b66f usr.sbin/dhcp/common/bpf.c
--- a/usr.sbin/dhcp/common/bpf.c Wed Apr 04 20:55:12 2001 +0000
+++ b/usr.sbin/dhcp/common/bpf.c Wed Apr 04 20:55:17 2001 +0000
@@ -47,7 +47,7 @@
#ifndef lint
static char copyright[] =
-"$Id: bpf.c,v 1.3.2.2 2000/12/13 22:47:20 he Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
+"$Id: bpf.c,v 1.3.2.3 2001/04/04 20:55:17 he Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -282,8 +282,8 @@
log_fatal ("Can't get bpf buffer length: %m");
info -> rbuf = dmalloc (info -> rbuf_max, MDL);
if (!info -> rbuf)
- log_fatal ("Can't allocate %d bytes for bpf input buffer.",
- info -> rbuf_max);
+ log_fatal ("Can't allocate %ld bytes for bpf input buffer.",
+ (long)(info -> rbuf_max));
info -> rbuf_offset = 0;
info -> rbuf_len = 0;
@@ -425,7 +425,7 @@
if (length <= 0)
return length;
interface -> rbuf_offset = 0;
- interface -> rbuf_len = length;
+ interface -> rbuf_len = BPF_WORDALIGN (length);
}
/* If there isn't room for a whole bpf header, something went
@@ -456,8 +456,9 @@
the packet won't fit in the input buffer, all we
can do is drop it. */
if (hdr.bh_caplen != hdr.bh_datalen) {
- interface -> rbuf_offset +=
- hdr.bh_hdrlen = hdr.bh_caplen;
+ interface -> rbuf_offset =
+ BPF_WORDALIGN (interface -> rbuf_offset +
+ hdr.bh_hdrlen + hdr.bh_caplen);
continue;
}
@@ -474,7 +475,9 @@
physical layer that supports this, but WTH), skip this
packet. */
if (offset < 0) {
- interface -> rbuf_offset += hdr.bh_caplen;
+ interface -> rbuf_offset =
+ BPF_WORDALIGN (interface -> rbuf_offset +
+ hdr.bh_caplen);
continue;
}
interface -> rbuf_offset += offset;
@@ -490,24 +493,31 @@
/* If the IP or UDP checksum was bad, skip the packet... */
if (offset < 0) {
- interface -> rbuf_offset += hdr.bh_caplen;
+ interface -> rbuf_offset =
+ BPF_WORDALIGN (interface -> rbuf_offset +
+ hdr.bh_caplen);
continue;
}
- interface -> rbuf_offset += offset;
+ interface -> rbuf_offset =
+ BPF_WORDALIGN (interface -> rbuf_offset + offset);
hdr.bh_caplen -= offset;
/* If there's not enough room to stash the packet data,
we have to skip it (this shouldn't happen in real
life, though). */
if (hdr.bh_caplen > len) {
- interface -> rbuf_offset += hdr.bh_caplen;
+ interface -> rbuf_offset =
+ BPF_WORDALIGN (interface -> rbuf_offset +
+ hdr.bh_caplen);
continue;
}
/* Copy out the data in the packet... */
memcpy (buf, interface -> rbuf + interface -> rbuf_offset,
hdr.bh_caplen);
- interface -> rbuf_offset += hdr.bh_caplen;
+ interface -> rbuf_offset =
+ BPF_WORDALIGN (interface -> rbuf_offset +
+ hdr.bh_caplen);
return hdr.bh_caplen;
} while (!length);
return 0;
diff -r e341fafa67f1 -r 0560fcc2b66f usr.sbin/dhcp/common/dhcp-options.5
--- a/usr.sbin/dhcp/common/dhcp-options.5 Wed Apr 04 20:55:12 2001 +0000
+++ b/usr.sbin/dhcp/common/dhcp-options.5 Wed Apr 04 20:55:17 2001 +0000
@@ -1,20 +1,39 @@
.\" dhcp-options.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:
+.\"
+.\" 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.
.\"
-.\" http://www.isc.org/isc-license-1.0.html.
+.\" 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.
.\"
-.\" 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.
+.\" 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 dhcpd-options 5
.SH NAME
dhcp-options - Dynamic Host Configuration Protocol options
@@ -107,20 +126,11 @@
.fi
.SH STANDARD DHCP OPTIONS
The documentation for the various options mentioned below is taken
-from the latest IETF draft document on DHCP options. Options which
-are not listed by name may be defined by the name option-\fInnn\fR,
-where \fInnn\fR is the decimal number of the option code. These
-options may be followed either by a string, enclosed in quotes, or by
-a series of octets, expressed as two-digit hexadecimal numbers seperated
-by colons. For example:
-.PP
-.nf
-option option-133 "my-option-133-text";
-option option-129 1:54:c9:2b:47;
-.fi
-.PP
-Because dhcpd does not know the format of these undefined option codes,
-no checking is done to ensure the correctness of the entered data.
+from the latest IETF draft document on DHCP options. Options not
+listed below may not yet be implemented, but it is possible to use
+such options by defining them in the configuration file. Please see
+the DEFINING NEW OPTIONS heading later in this document for more
+information.
.PP
The standard options are:
.PP
@@ -629,6 +639,10 @@
term "SLP Agent" is being used to refer to a Service Location Protocol
agent running on a machine that is being configured using the DHCP
protocol.
+.PP
+Also, please be aware that some companies may refer to SLP as NDS.
+If you have an NDS directory agent whose address you need to
+configure, the slp-directory-agent option should work.
.RE
.PP
.B option slp-service-scope \fIboolean text\fR\fB;\fR
@@ -786,6 +800,16 @@
specified in this list, the URLs are seperated by spaces.
.RE
.PP
+.B option \fBuser-class\fR \fIstring\fR\fB;\fR
+.RS 0.25i
+.PP
+This option is used by some DHCP clients as a way for users to
+specify identifying information to the client. This can be used in a
+similar way to the vendor-class-identifier option, but the value of
+the option is specified by the user, not the vendor. Most recent
+DHCP clients have a way in the user interface to specify the value for
+this identifier, usually as a text string.
+.PP
.B option \fBvendor-class-identifier\fR \fIstring\fR\fB;\fR
.RS 0.25i
.PP
diff -r e341fafa67f1 -r 0560fcc2b66f usr.sbin/dhcp/common/tables.c
--- a/usr.sbin/dhcp/common/tables.c Wed Apr 04 20:55:12 2001 +0000
+++ b/usr.sbin/dhcp/common/tables.c Wed Apr 04 20:55:17 2001 +0000
@@ -3,7 +3,7 @@
Tables of information... */
/*
- * Copyright (c) 1995-2000 Internet Software Consortium.
+ * Copyright (c) 1995-2001 Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#ifndef lint
Home |
Main Index |
Thread Index |
Old Index