# removes the comment characters from the appropriate set of
# assignments, and writes the output to Makefile.
-## NEXTSTEP 3.x,4.x
+## AIX 4.1.5.0
+##--aix--
+#CF = cf/aix.h
+#CC=cc -Daix
+#INSTALL=/usr/ucb/install
+#MANINSTALL=/usr/ucb/install
+#ADMMANEXT = .8
+#FFMANEXT = .5
+#VARRUN = /etc
+#VARDB = /etc
+##--aix--
+
+ NEXTSTEP 3.x,4.x
##--nextstep--
#LIBS =
#CF = cf/nextstep.h
#CF = cf/alphaosf.h
#ADMMANEXT = .8
#FFMANEXT = .5
-#VARRUN = /etc
#VARDB = /etc
##--alphaosf--
Internet Software Consortium
Dynamic Host Configuration Protocol Distribution
Version 3, Alpha Snapshot
- March 15, 1998
+ March 26, 1998
This is an alpha test snapshot of Version 3 of the Internet Software
Consortium DHCP Distribution. In version 3, this distribution
not something you should be running in a production environment where
stability is your highest priority.
+ DOCUMENTATION
+
+Documentation for this software includes this README file, the
+RELNOTES file, and the manual pages, which are in the server, common,
+client and relay subdirectories. Internet standards relating to the
+DHCP protocol are stored in the doc subdirectory. You will have the
+best luck reading the manual pages if you build this software and then
+install it, although you can read them directly out of the
+distribution if you need to.
+
+DHCP server documentation is in the dhcpd man page. Information about
+the DHCP server lease database is in the dhcpd.leases man page.
+Server configuration documentation is in the dhcpd.conf man page as
+well as the dhcp-options man page. A sample DHCP server
+configuration is in the file server/dhcpd.conf.
+
+DHCP Client documentation is in the dhclient man page. DHCP client
+configuration documentation is in the dhclient.conf man page and the
+dhcp-options man page. The DHCP client configuration script is
+documented in the dhclient-script man page. The format of the DHCP
+client lease database is documented in the dhclient.leases man page.
+
+DHCP relay agent documentation is in the dhcrelay man page.
+
+To read installed manual pages, use the man command. Type "man page"
+where page is the name of the manual page.
+
+If you want to read manual pages that aren't installed, you can type
+``nroff -man page |more'' where page is the filename of the
+unformatted manual page. The filename of an unformatted manual page
+is the name of the manual page, followed by '.', followed by some
+number - 5 for documentation about files, and 8 for documentation
+about programs.
+
+If you do not have the nroff command, you can type ``more catpage''
+where catpage is the filename of the catted man page. Catted man
+pages names are the name of the manual page followed by ".cat"
+followed by 5 or 8, as with unformatted manual pages.
+
+Please note that until you install the manual pages, the pathnames of
+files to which they refer will not be correct for your operating
+system.
+
+ RELEASE STATUS
+
In this release, the server and relay agent currently work well on
NetBSD, Linux, FreeBSD, BSD/OS, Ultrix, Digital Alpha OSF/1, and SunOS
4.1.4. They can also be run usefully on Solaris as long as only one
To build the DHCP Distribution, unpack the compressed tar file using
the tar utility and the gzip command - type something like:
- zcat dhcp-3.0-alpha-19990315.tar.gz |tar xvf -
+ zcat dhcp-3.0-alpha-19990326.tar.gz |tar xvf -
-Now, cd to the dhcp-3.0-alpha-19990315 subdirectory that you've just
+Now, cd to the dhcp-3.0-alpha-19990326 subdirectory that you've just
created and configure the source tree by typing:
./configure
Internet Software Consortium
Dynamic Host Configuration Protocol Distribution
Version 3, Alpha Snapshot
- March 15, 1999
+ March 26, 1999
Release Notes
when you try to use it. Pointing out inconsistencies between the
documentation and the source code will always be appreciated.
+ Changes since March 15, 1999
+
+- Support added for AIX 4.1.5.0 (and hopefully other versions).
+
+- Use /var/run instead of /etc on Digital Unix.
+
+- Change DHCP client exponential backoff code to back off more slowly,
+ so that it is more robust in lossy environments, at the expense of
+ being a bit less polite to the server.
+
+- Don't request a specific lease interval in the client unless the
+ user says to do so.
+
+- Don't print DHCPXXX in wrong xxx messages unless DEBUG is defined.
+
+- Fix handling of secs field.
+
+- Fix handling of append statement.
+
+- Fix documentation for append and prepend statements.
+
+- Fix server support for parameter request list and maximum message
+ size.
+
+- Parameterize more hardware types in discover_interfaces. Check for
+ IFF_BROADCAST instead of !IFF_POINTOPOINT
+
+- Print kernel configuration warning message if we get EINVAL when
+ opening or configuring the Linux packet filter.
+
+- Fix a bug in UDP checksum code (thanks to John Nemeth for figuring
+ this out) and re-enable UDP checksumming. This allows the client
+ to work with some buggy DHCP servers that can't handle zero
+ checksums in the UDP header - in particular, the one John's cable
+ modem ISP is using.
+
+- Don't report packet header checksum errors unless we see a lot of
+ them. It's perfectly normal for some number of checksum errors to
+ occur.
+
+- Refer to the dhcpd.leases man page when printing an error message
+ prior to exiting because there's no lease database.
+
+- Add information to the README telling the reader how to get to the
+ manual pages.
+
+- Fix the server packet transmission code to unicast when it can.
+
+- Fix a typo in the dhcpd.conf manual page.
+
+
+
CHANGES SINCE VERSION 2.0
- Support for conditional behaviour - i.e., what the client sends can
#ifndef lint
static char copyright[] =
-"$Id: clparse.c,v 1.29 1999/03/25 21:45:55 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
+"$Id: clparse.c,v 1.30 1999/03/26 19:19:43 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
top_level_config.select_interval = 0;
top_level_config.reboot_timeout = 10;
top_level_config.retry_interval = 300;
- top_level_config.backoff_cutoff = 120;
- top_level_config.initial_interval = 10;
+ top_level_config.backoff_cutoff = 15;
+ top_level_config.initial_interval = 3;
top_level_config.bootp_policy = P_ACCEPT;
top_level_config.script_name = "/etc/dhclient-script";
top_level_config.requested_options = default_requested_options;
- top_level_config.requested_lease = 7200;
top_level_config.on_receipt = new_group ("read_client_conf");
if (!top_level_config.on_receipt)
#ifndef lint
static char ocopyright[] =
-"$Id: dhclient.c,v 1.63 1999/03/25 21:51:29 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhclient.c,v 1.64 1999/03/26 19:19:43 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
packet -> raw -> hlen) ||
(memcmp (packet -> interface -> hw_address.haddr,
packet -> raw -> chaddr, packet -> raw -> hlen))) {
+#if defined (DEBUG)
log_debug ("DHCPACK in wrong transaction.");
+#endif
return;
}
client -> state != S_REQUESTING &&
client -> state != S_RENEWING &&
client -> state != S_REBINDING) {
+#if defined (DEBUG)
log_debug ("DHCPACK in wrong state.");
+#endif
return;
}
packet -> raw -> hlen) ||
(memcmp (packet -> interface -> hw_address.haddr,
packet -> raw -> chaddr, packet -> raw -> hlen))) {
+#if defined (DEBUG)
log_debug ("%s in wrong transaction.", name);
+#endif
return;
}
packet -> raw -> hlen) ||
(memcmp (packet -> interface -> hw_address.haddr,
packet -> raw -> chaddr, packet -> raw -> hlen))) {
+#if defined (DEBUG)
log_debug ("DHCPNAK in wrong transaction.");
+#endif
return;
}
client -> state != S_REQUESTING &&
client -> state != S_RENEWING &&
client -> state != S_REBINDING) {
+#if defined (DEBUG)
log_debug ("DHCPNAK in wrong state.");
+#endif
return;
}
log_info ("DHCPNAK from %s", piaddr (packet -> client_addr));
if (!client -> active) {
+#if defined (DEBUG)
log_info ("DHCPNAK with no active lease.\n");
+#endif
return;
}
}
}
- if (!(oc = lookup_option (options -> dhcp_hash,
- DHO_DHCP_LEASE_TIME))) {
- if (!buffer_allocate (&bp, sizeof (u_int32_t),
- "make_client_options"))
- log_error ("can't make buffer for requested lease time.");
- else {
- putULong (bp -> data,
- client -> config -> requested_lease);
- if (!(make_const_option_cache
- (&oc, &bp, (u_int8_t *)0, sizeof (u_int32_t),
- &dhcp_options [DHO_DHCP_LEASE_TIME],
- "make_client_options")))
- log_error ("can't make option cache");
- else {
- save_option (options -> dhcp_hash, oc);
- option_cache_dereference
- (&oc, "make_client_options");
- }
- }
- }
- /* oc = (struct option_cache *)0; (we'd need this if we were
- going to use oc again */
-
/* Run statements that need to be run on transmission. */
if (client -> config -> on_transmission)
execute_statements_in_scope
#ifndef lint
static char copyright[] =
-"$Id: discover.c,v 1.7 1999/03/25 21:57:30 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: discover.c,v 1.8 1999/03/26 19:19:44 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
/* Skip loopback, point-to-point and down interfaces,
except don't skip down interfaces if we're trying to
get a list of configurable interfaces. */
- if ((((ifr.ifr_flags & IFF_LOOPBACK) ||
-#ifdef HAVE_IFF_POINTOPOINT
- (ifr.ifr_flags & IFF_POINTOPOINT))
- && !tmp) ||
-#endif
+ if ((!(ifr.ifr_flags & IFF_BROADCAST) && !tmp) ||
(!(ifr.ifr_flags & IFF_UP) &&
state != DISCOVER_UNCONFIGURED))
continue;
case ARPHRD_TUNNEL:
/* ignore tunnel interfaces. */
#endif
+#ifdef HAVE_ARPHRD_ROSE
+ case ARPHRD_ROSE:
+#endif
#ifdef HAVE_ARPHRD_LOOPBACK
case ARPHRD_LOOPBACK:
/* ignore loopback interface */
memcpy (tmp -> hw_address.haddr, sa.sa_data, 6);
break;
-#ifndef ARPHRD_IEEE802
+#ifndef HAVE_ARPHRD_IEEE802
# define ARPHRD_IEEE802 HTYPE_IEEE802
#endif
case ARPHRD_IEEE802:
memcpy (tmp -> hw_address.haddr, sa.sa_data, 6);
break;
-#ifndef ARPHRD_FDDI
+#ifndef HAVE_ARPHRD_FDDI
# define ARPHRD_FDDI HTYPE_FDDI
#endif
case ARPHRD_FDDI:
break;
#endif
+#ifdef HAVE_ARPHRD_AX25
+ case ARPHRD_AX25:
+ tmp -> hw_address.hlen = 6;
+ tmp -> hw_address.htype = ARPHRD_AX25;
+ memcpy (tmp -> hw_address.haddr, sa.sa_data, 6);
+ break;
+#endif
+
+#ifdef HAVE_ARPHRD_NETROM
+ case ARPHRD_NETROM:
+ tmp -> hw_address.hlen = 6;
+ tmp -> hw_address.htype = ARPHRD_NETROM;
+ memcpy (tmp -> hw_address.haddr, sa.sa_data, 6);
+ break;
+#endif
+
default:
log_error ("%s: unknown hardware address type %d",
ifr.ifr_name, sa.sa_family);
#ifndef lint
static char copyright[] =
-"$Id: lpf.c,v 1.8 1999/03/16 06:37:49 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: lpf.c,v 1.9 1999/03/26 19:19:44 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
if ((sock = socket(PF_PACKET, SOCK_PACKET, htons(ETH_P_ALL))) < 0) {
if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT ||
errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT ||
- errno == EAFNOSUPPORT)
+ errno == EAFNOSUPPORT || errno == EINVAL)
log_fatal ("socket: %m - make sure %s %s!",
"CONFIG_PACKET and CONFIG_FILTER are defined",
"in your kernel configuration");
if (bind (sock, &sa, sizeof sa)) {
if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT ||
errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT ||
- errno == EAFNOSUPPORT)
+ errno == EAFNOSUPPORT || errno = EINVAL)
log_fatal ("socket: %m - make sure %s %s!",
"CONFIG_PACKET and CONFIG_FILTER are defined",
"in your kernel configuration");
#ifndef lint
static char copyright[] =
-"$Id: packet.c,v 1.22 1999/03/25 21:58:13 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: packet.c,v 1.23 1999/03/26 19:19:44 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
/* Compute UDP checksums, including the ``pseudo-header'', the UDP
header and the data. */
-#if 0
udp.uh_sum =
wrapsum (checksum ((unsigned char *)&udp, sizeof udp,
checksum (data, len,
checksum ((unsigned char *)
&ip.ip_src,
- sizeof ip.ip_src,
+ 2 * sizeof ip.ip_src,
IPPROTO_UDP +
(u_int32_t)
ntohs (udp.uh_ulen)))));
-#endif
/* Copy the udp header into the buffer... */
memcpy (&buf [*bufix], &udp, sizeof udp);
struct udphdr *udp;
u_int32_t ip_len = (buf [bufix] & 0xf) << 2;
u_int32_t sum, usum;
- static int packets_seen, packets_bad_checksum;
ip = (struct ip *)(buf + bufix);
udp = (struct udphdr *)(buf + bufix + ip_len);
/* Check the IP header checksum - it should be zero. */
if (wrapsum (checksum (buf + bufix, ip_len, 0))) {
+ static int packets_seen;
+ static int packets_bad_checksum;
+
if (packets_seen &&
(++packets_seen / ++packets_bad_checksum) < 2)
log_info ("Bad IP checksum: %x",
len -= ip_len + sizeof *udp;
}
-#if 0
usum = udp -> uh_sum;
udp -> uh_sum = 0;
checksum (data, len,
checksum ((unsigned char *)
&ip -> ip_src,
- sizeof ip -> ip_src,
+ 2 * sizeof ip -> ip_src,
IPPROTO_UDP +
(u_int32_t)
ntohs (udp -> uh_ulen)))));
if (usum && usum != sum) {
- log_info ("Bad udp checksum: %x %x", usum, sum);
+ static int packets_seen;
+ static int packets_bad_checksum;
+ if (packets_seen &&
+ (++packets_seen / ++packets_bad_checksum) < 2)
+ log_info ("Bad udp checksum: %x %x", usum, sum);
return -1;
}
-#endif
/* Copy out the port... */
memcpy (&from -> sin_port, &udp -> uh_sport, sizeof udp -> uh_sport);
/* upf.c
- Ultrix PacketFilter interface code.
+ Ultrix PacketFilter interface code. */
/*
* Copyright (c) 1996-1999 Internet Software Consortium.
#ifndef lint
static char copyright[] =
-"$Id: upf.c,v 1.10 1999/03/16 06:37:50 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: upf.c,v 1.11 1999/03/26 19:19:44 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
if [ "$sysname" = "" ]; then
case $uname in
+ AIX)
+ sysname=aix;;
Rhapsody)
sysname=rhapsody;;
ULTRIX)
echo "configuration that isn't supported or hasn't been tested."
echo
echo "Supported configurations are:"
+ echo " aix AIX 4.1.5.0"
echo " ultrix ULTRIX 4.2A or higher"
echo " bsdos BSDI BSD/OS 2.1"
echo " alphaosf DEC Alpha OSF/1"
--- /dev/null
+/* aix.h */
+/*
+ * Copyright (c) 1996 The Internet Software Consortium. All rights reserved.
+ *
+ * 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.
+ *
+ * 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
+ * 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.
+ *
+ */
+
+#define int8_t char
+#define int16_t short
+#define int32_t long
+
+#define u_int8_t unsigned char
+#define u_int16_t unsigned short
+#define u_int32_t unsigned long
+
+#include <sys/types.h>
+
+#include <syslog.h>
+
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/select.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <setjmp.h>
+#include <limits.h>
+
+extern int h_errno;
+
+#include <net/if.h>
+#include <net/if_arp.h>
+#include <net/if_dl.h>
+
+#ifndef _PATH_DHCPD_PID
+#define _PATH_DHCPD_PID "/etc/dhcpd.pid"
+#endif
+#ifndef _PATH_DHCLIENT_PID
+#define _PATH_DHCLIENT_PID "/etc/dhclient.pid"
+#endif
+#ifndef _PATH_DHCRELAY_PID
+#define _PATH_DHCRELAY_PID "/etc/dhcrelay.pid"
+#endif
+
+#include <varargs.h>
+#define VA_DOTDOTDOT va_alist
+#define VA_start(list, last) va_start (list)
+
+#define vsnprintf(buf, size, fmt, list) vsprintf (buf, fmt, list)
+#define NO_SNPRINTF
+
+#define EOL '\n'
+#define VOIDPTR void *
+
+#include <time.h>
+
+#define TIME time_t
+#define GET_TIME(x) time ((x))
+
+#define random rand
+
+#define USE_SOCKETS 1
+#define HAVE_SA_LEN 1
+#undef FDDI
# endif
#endif
+#ifdef aix
+# include "cf/aix.h"
+#endif
+
#ifdef bsdi
# include "cf/bsdos.h"
#endif
# define HAVE_ARPHRD_LOOPBACK
#endif
+#if defined (ARPHRD_ROSE) && !defined (HAVE_ARPHRD_ROSE)
+# define HAVE_ARPHRD_ROSE
+#endif
+
+#if defined (ARPHRD_IEEE802) && !defined (HAVE_ARPHRD_IEEE802)
+# define HAVE_ARPHRD_IEEE802
+#endif
+
+#if defined (ARPHRD_FDDI) && !defined (HAVE_ARPHRD_FDDI)
+# define HAVE_ARPHRD_FDDI
+#endif
+
+#if defined (ARPHRD_AX25) && !defined (HAVE_ARPHRD_AX25)
+# define HAVE_ARPHRD_AX25
+#endif
+
+#if defined (ARPHRD_NETROM) && !defined (HAVE_ARPHRD_NETROM)
+# define HAVE_ARPHRD_NETROM
+#endif
+
#if defined (ARPHRD_METRICOM) && !defined (HAVE_ARPHRD_METRICOM)
# define HAVE_ARPHRD_METRICOM
#endif
#ifndef lint
static char copyright[] =
-"$Id: confpars.c,v 1.66 1999/03/25 22:05:19 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
+"$Id: confpars.c,v 1.67 1999/03/26 19:19:45 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
human has corrected the database problem, then we are left
thinking that no leases have been assigned to anybody, which
could create severe network chaos. */
- if ((cfile = fopen (path_dhcpd_db, "r")) == NULL)
- log_fatal ("Can't open lease database %s: %m -- %s",
- path_dhcpd_db,
- "check for failed database rewrite attempt!");
+ if ((cfile = fopen (path_dhcpd_db, "r")) == NULL) {
+ log_error ("Can't open lease database %s: %m -- %s",
+ path_dhcpd_db,
+ "check for failed database rewrite attempt!");
+ log_error ("Please read the dhcpd.leases manual page if you");
+ log_fatal ("don't know what to do about this.");
+ }
+
do {
token = next_token (&val, cfile);
if (token == EOF)
The
.I hardware-address
should be a set of hexadecimal octets (numbers from 0 through ff)
-seperated by colons. The \fIhardwarefR statement may also be used
+seperated by colons. The \fIhardware\fR statement may also be used
for DHCP clients.
.PP
.B The