diff -rNc2 dhcp-2.0b1pl6/Makefile.conf dhcp-2.0b1pl18/Makefile.conf *** dhcp-2.0b1pl6/Makefile.conf Fri Jun 26 11:19:04 1998 --- dhcp-2.0b1pl18/Makefile.conf Sat Feb 27 13:41:10 1999 *************** *** 1,5 **** # Makefile.conf # ! # Copyright (c) 1996, 1997, 1998 The Internet Software Consortium. # All rights reserved. # --- 1,5 ---- # Makefile.conf # ! # Copyright (c) 1996, 1997, 1998, 1999 The Internet Software Consortium. # All rights reserved. # *************** *** 40,44 **** FFMANEXT = .0 INSTALL = install -c ! MANINSTALL = install -c CHMOD = chmod CATMANPAGES = --- 40,44 ---- FFMANEXT = .0 INSTALL = install -c ! MANINSTALL = install -c -m 444 CHMOD = chmod CATMANPAGES = *************** *** 177,181 **** ## Linux 1.x ##--linux-1-- ! #COPTS = -DLINUX_1_X #CF = cf/linux.h #ADMMANDIR = /usr/man/man8 --- 177,181 ---- ## Linux 1.x ##--linux-1-- ! #COPTS = -DLINUX_MAJOR=1 -DLINUX_MINOR=0 #CF = cf/linux.h #ADMMANDIR = /usr/man/man8 *************** *** 184,188 **** #FFMANEXT = .5 #VARRUN = /var/run ! #VARDB = /var/dhcpd #SCRIPT=linux ##--linux-1-- --- 184,188 ---- #FFMANEXT = .5 #VARRUN = /var/run ! #VARDB = /var/state/dhcp # see rationale in includes/cf/linux.h #SCRIPT=linux ##--linux-1-- *************** *** 190,194 **** ## Linux 2.0 ##--linux-2.0-- ! #COPTS = -DLINUX_2_0 #CF = cf/linux.h #ADMMANDIR = /usr/man/man8 --- 190,194 ---- ## Linux 2.0 ##--linux-2.0-- ! #COPTS = -DLINUX_MAJOR=2 -DLINUX_MINOR=0 #CF = cf/linux.h #ADMMANDIR = /usr/man/man8 *************** *** 197,201 **** #FFMANEXT = .5 #VARRUN = /var/run ! #VARDB = /var/dhcpd #SCRIPT=linux ##--linux-2.0-- --- 197,201 ---- #FFMANEXT = .5 #VARRUN = /var/run ! #VARDB = /var/state/dhcp # see rationale in includes/cf/linux.h #SCRIPT=linux ##--linux-2.0-- *************** *** 203,216 **** ## Linux 2.1 ##--linux-2.1-- ! #COPTS = -DLINUX_2_1 #CF = cf/linux.h #ADMMANDIR = /usr/man/man8 #ADMMANEXT = .8 ! #FFMANDIR = /usr/man/man5 #FFMANEXT = .5 #VARRUN = /var/run ! #VARDB = /var/dhcpd #SCRIPT=linux ##--linux-2.1-- ## SCO --- 203,229 ---- ## Linux 2.1 ##--linux-2.1-- ! #COPTS = -DLINUX_MAJOR=2 -DLINUX_MINOR=1 #CF = cf/linux.h #ADMMANDIR = /usr/man/man8 #ADMMANEXT = .8 ! #FFMANDIR = /usr/share/man/man5 #FFMANEXT = .5 #VARRUN = /var/run ! #VARDB = /var/state/dhcp # see rationale in includes/cf/linux.h #SCRIPT=linux ##--linux-2.1-- + + ## Linux 2.2 + ##--linux-2.2-- + #COPTS = -DLINUX_MAJOR=2 -DLINUX_MINOR=2 + #CF = cf/linux.h + #ADMMANDIR = /usr/man/man8 + #ADMMANEXT = .8 + #FFMANDIR = /usr/share/man/man5 + #FFMANEXT = .5 + #VARRUN = /var/run + #VARDB = /var/state/dhcp # see rationale in includes/cf/linux.h + #SCRIPT=linux + ##--linux-2.2-- ## SCO diff -rNc2 dhcp-2.0b1pl6/Makefile.dist dhcp-2.0b1pl18/Makefile.dist *** dhcp-2.0b1pl6/Makefile.dist Sat Dec 6 03:23:46 1997 --- dhcp-2.0b1pl18/Makefile.dist Tue Feb 23 10:08:50 1999 *************** *** 36,52 **** @for dir in ${SUBDIRS}; do \ echo "Making all in $$dir"; \ ! (cd $$dir; $(MAKE) all); \ done install: @for dir in ${SUBDIRS}; do \ echo "Installing in $$dir"; \ ! (cd $$dir; $(MAKE) install); \ done clean: @for dir in ${SUBDIRS}; do \ echo "Cleaning in $$dir"; \ ! (cd $$dir; $(MAKE) clean); \ done --- 36,82 ---- @for dir in ${SUBDIRS}; do \ echo "Making all in $$dir"; \ ! (cd $$dir; $(MAKE) all) || exit 1; \ done + @if [ `uname` = Linux ]; then \ + echo; \ + echo " !!!! WARNING !!!!"; \ + echo ; \ + echo "The default location for the dhcpd.leases file has \ + changed!!!"; \ + echo; \ + echo "It is now in /var/state/dhcp. If you are not"; \ + echo "installing this for the first time, please move your"; \ + echo "lease database to the new location before using this"; \ + echo "software."; \ + echo; \ + echo " !!!! WARNING !!!!"; \ + echo; \ + fi install: @for dir in ${SUBDIRS}; do \ echo "Installing in $$dir"; \ ! (cd $$dir; $(MAKE) install) || exit 1; \ done + @if [ `uname` = Linux ]; then \ + echo; \ + echo " !!!! WARNING !!!!"; \ + echo ; \ + echo "The default location for the dhcpd.leases file has \ + changed!!!"; \ + echo; \ + echo "It is now in /var/state/dhcp. If you are not"; \ + echo "installing this for the first time, please move your"; \ + echo "lease database to the new location before using this"; \ + echo "software."; \ + echo; \ + echo " !!!! WARNING !!!!"; \ + echo; \ + fi clean: @for dir in ${SUBDIRS}; do \ echo "Cleaning in $$dir"; \ ! (cd $$dir; $(MAKE) clean) || exit 1; \ done *************** *** 54,58 **** @for dir in ${SUBDIRS}; do \ echo "Really cleaning in $$dir"; \ ! (cd $$dir; $(MAKE) realclean); \ done --- 84,88 ---- @for dir in ${SUBDIRS}; do \ echo "Really cleaning in $$dir"; \ ! (cd $$dir; $(MAKE) realclean) || exit 1; \ done *************** *** 60,64 **** @for dir in ${SUBDIRS}; do \ echo "Really, really cleaning in $$dir"; \ ! (cd $$dir; $(MAKE) distclean); \ done @rm -f Makefile --- 90,94 ---- @for dir in ${SUBDIRS}; do \ echo "Really, really cleaning in $$dir"; \ ! (cd $$dir; $(MAKE) distclean) || exit 1; \ done @rm -f Makefile diff -rNc2 dhcp-2.0b1pl6/README dhcp-2.0b1pl18/README *** dhcp-2.0b1pl6/README Sat Dec 6 03:59:06 1997 --- dhcp-2.0b1pl18/README Fri Mar 5 08:13:53 1999 *************** *** 1,6 **** Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 0 ! December 6, 1997 This is the first Beta release of Version 2 of the Internet Software --- 1,6 ---- Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 18 ! March 5, 1998 This is the first Beta release of Version 2 of the Internet Software *************** *** 13,23 **** In this release, the server and relay agent currently work well on ! Digital Alpha OSF/1, SunOS 4.1.4, NetBSD, FreeBSD, BSD/OS and Ultrix. ! They can also be run usefully on Solaris as long as only one broadcast ! network interface is configured. They also runs on QNX and Linux as long as only one broadcast network interface is configured and a host route is added from that interface to the 255.255.255.255 broadcast ! address. If you are running a Linux 2.0.31 kernel, the DHCP daemons ! may be able to operate on more than one interface. The DHCP client currently only knows how to configure the network on --- 13,24 ---- 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 ! broadcast network interface is configured. They also runs on QNX as long as only one broadcast network interface is configured and a host route is added from that interface to the 255.255.255.255 broadcast ! address. If you are running a Linux 2.0.30 or previous kernel, the ! DHCP daemons will only be able to operate on machines with a single ! network interface. The DHCP client currently only knows how to configure the network on *************** *** 28,32 **** If you wish to run the DHCP Distribution on Linux, please see the ! Linux-specific notes later in this document. If you wish to run on a SCO release, please see the SCO-specific notes later in this document. You particularly need to read these notes if you intend to support --- 29,33 ---- If you wish to run the DHCP Distribution on Linux, please see the ! Linux-specific notes later in this document. If you wish to run on an SCO release, please see the SCO-specific notes later in this document. You particularly need to read these notes if you intend to support *************** *** 44,58 **** BUILDING THE DHCP DISTRIBUTION ! To build the DHCP Distribution, type ``configure''. If configure can ! figure out what sort of system you're running on, it will create a ! custom Makefile for you for that system; otherwise, it will complain. ! If it can't figure out what system you are using, that system is not ! supported - you are on your own. ! ! Once you've run configure, just type ``make'', and after a while you ! should have a dhcp server. If you get compile errors on one of the ! supported systems mentioned earlier, please let us know. If you get ! errors on a system not mentioned above, you will need to do some ! programming or debugging on your own to get the DHCP Distribution working. LINUX --- 45,78 ---- BUILDING THE DHCP DISTRIBUTION ! To build the DHCP Distribution, unpack the compressed tar file using ! the tar utility and the gzip command - type something like: ! ! zcat dhcp-2.0b1pl18.tar.gz |tar xvf - ! ! Now, cd to the dhcp-2.0b1pl18 subdirectory that you've just created and ! configure the source tree by typing: ! ! ./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 ! system; otherwise, it will complain. If it can't figure out what ! system you are using, that system is not supported - you are on ! your own. ! ! Once you've run configure, just type ``make'', and after a while ! you should have a dhcp server. If you get compile errors on one ! of the supported systems mentioned earlier, please let us know. ! If you get warnings, it's not likely to be a problem - the DHCP ! server compiles completely warning-free on as many architectures ! as we can manage, but there are a few for which this is difficult. ! If you get errors on a system not mentioned above, you will need ! to do some programming or debugging on your own to get the DHCP ! Distribution working. ! ! Once you have successfully gotten the DHCP Distribution to build, you ! can install it by typing ``make install''. If you already have an old ! version of the DHCP Distribution installed, you may want to save it ! before typing ``make install''. LINUX *************** *** 60,66 **** There are three big LINUX issues: the all-ones broadcast address, Linux 2.1 ip_bootp_agent enabling, and operations with more than one ! network interface. ! BROADCAST In order for dhcpd to work correctly with picky DHCP clients (e.g., --- 80,119 ---- There are three big LINUX issues: the all-ones broadcast address, Linux 2.1 ip_bootp_agent enabling, and operations with more than one ! 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: SO_ATTACH_FILTER UNDECLARED ! ! In addition, there is a minor issue that we will mention here because ! this release is so close on the heels of the Linux 2.2 release: there ! is a symlink in /usr/include that points at the linux asm headers. It ! appears to be not uncommon that this link won't be updated correctly, ! in which case you'll get the following error when you try to build: ! ! lpf.c: In function `if_register_receive': ! lpf.c:152: `SO_ATTACH_FILTER' undeclared (first use this function) ! lpf.c:152: (Each undeclared identifier is reported only once ! lpf.c:152: for each function it appears in.) ! ! The line numbers may be different, of course. If you see this ! header, your linux asm header link is probably bad, and you should ! make sure it's pointing to correct linux source directory. ! ! LINUX: PROTOCOL NOT CONFIGURED ! ! One additional Linux 2.1/2.2 issue: if you get the following message, ! it's because your kernel doesn't have the linux packetfilter ! configured: ! ! Can't install packet filter program: Protocol not available ! exiting. ! ! If this happens, you need to edit your linux kernel .config file, set ! CONFIG_FILTER=y, and rebuild your kernel. If the preceding sentence ! made no sense to you, ask your Linux vendor/guru for help - please ! don't ask us. ! LINUX: BROADCAST In order for dhcpd to work correctly with picky DHCP clients (e.g., *************** *** 97,101 **** specify the network interface you *are* using in your route command. ! IP BOOTP AGENT Some versions of the Linux 2.1 kernel apparently prevent dhcpd from --- 150,154 ---- specify the network interface you *are* using in your route command. ! LINUX: IP BOOTP AGENT Some versions of the Linux 2.1 kernel apparently prevent dhcpd from *************** *** 105,109 **** ! MULTIPLE INTERFACES Most older versions of the Linux kernel do not provide a networking --- 158,162 ---- ! LINUX: MULTIPLE INTERFACES Most older versions of the Linux kernel do not provide a networking *************** *** 114,131 **** is possible for dhcpd to operate on Linux with more than one network interface. In order to take advantage of this, you must be running a ! 2.0.31 or greater kernel, and you must have 2.0.31 system headers ! installed *before* you build dhcpd. ! ! NOTE: People have been having problems finding the 2.0.31 kernel ! because it was only available as a prerelease patch. As of October ! 17, Linux 2.0.31 is the stable Linux kernel, and is available as a ! kernel distribution rather than as a test patch. With any luck, it ! will be in the latest version of your favourite Linux distribution ! soon. ! ! If you are running a Linux 2.1 kernel, this does not guarantee that you ! have SO_BINDTODEVICE. Linux 2.0.31 was released quite a while after 2.1 ! kernel development began. The earliest Linux kernel in the 2.1 ! development stream with SO_BINDTODEVICE is version 2.1.68. We have heard reports that you must still add routes to 255.255.255.255 --- 167,172 ---- is possible for dhcpd to operate on Linux with more than one network interface. In order to take advantage of this, you must be running a ! 2.0.31 or greater kernel, and you must have 2.0.31 or later system ! headers installed *before* you build the DHCP Distribution. We have heard reports that you must still add routes to 255.255.255.255 *************** *** 189,192 **** --- 230,266 ---- extension, which is not included in the base NextStep system. You must install this extension in order to get dhcpd or dhclient to work. + + SOLARIS + + One problem which has been observed and is not fixed in this + patchlevel has to do with using DLPI on Solaris machines. The symptom + of this problem is that the DHCP server never receives any requests. + If you are using Solaris 2.6, and you encounter this symptom, and + you are running the DHCP server on a machine with a single broadcast + network interface, you may wish to edit the includes/site.h file and + uncomment the #define USE_SOCKETS line. Then type ``make clean; + make''. + + The DHCP client on Solaris will only work with DLPI. If you run it + and it just keeps saying it's sending DHCPREQUEST packets, but never + gets a response, you may be having DLPI trouble as described above. + If so, you are SOL. Also, because Solaris requires you to "plumb" an + interface before it can be detected by the DHCP client, you must + either specify the name(s) of the interface(s) you want to configure + on the command line, or must plumb the interfaces prior to invoking + the DHCP client. This can be done with ``ifconfig iface plumb'', + where iface is the name of the interface (e.g., ``ifconfig hme0 + plumb''). + + It should be noted that Solaris versions from 2.6 onward include a + DHCP client that you can run with ``/sbin/ifconfig iface dhcp start'' + 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 + 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. SUPPORT diff -rNc2 dhcp-2.0b1pl6/RELNOTES dhcp-2.0b1pl18/RELNOTES *** dhcp-2.0b1pl6/RELNOTES Fri Jun 26 14:09:45 1998 --- dhcp-2.0b1pl18/RELNOTES Fri Mar 5 08:11:54 1999 *************** *** 1,6 **** Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 6 ! June 26, 1998 Release Notes --- 1,6 ---- Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 18 ! March 5, 1998 Release Notes *************** *** 14,19 **** Version 1 of the ISC DHCP Distribution includes just a DHCP Server. Version 1 has been in feature freeze since late 1996, and is quite ! stable. This is the release that we would expect most sites to run in ! production. Version 2 of the ISC DHCP Distribution adds a DHCP Client and a --- 14,19 ---- Version 1 of the ISC DHCP Distribution includes just a DHCP Server. Version 1 has been in feature freeze since late 1996, and is quite ! stable. This is the release that we would expect very conservative ! sites to run in production, but it is no longer recommended. Version 2 of the ISC DHCP Distribution adds a DHCP Client and a *************** *** 34,49 **** using are disciplined quickly. ! This version is now in Beta testing, and is planned for release in ! mid-1998. It has a number of new features, and is the release that we ! would expect sites that want some stability but need the new lease ! testing feature, or need a client or relay agent. Note that it is ! possible to run the Version 1 server with the Version 2 client. ! Version 3 of the ISC DHCP Distribution will add Dynamic DNS Support, asynchronous DNS query resolution, DHCP Authentication, and possibly support for a DHCP Interserver Protocol and live querying of the DHCP ! database. This release is not expected to be stable in the near ! future, and is intended for sites that are in a position to experiment, or for sites that desperately need the new features. CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 5 --- 34,376 ---- using are disciplined quickly. ! This version has been in a near feature freeze since January of 1998, ! has been in Beta test since then, and is planned for final release in ! mid-1999. It has a number of important features, and is the release ! that we would expect most sites to run. It is possible to run the ! Version 1 server with the Version 2 client at sites that want to be ! really conservative. ! Version 3 of the ISC DHCP Distribution will add conditional behaviour, ! client classing, Dynamic DNS Support, DHCPv4 16-bit option codes, asynchronous DNS query resolution, DHCP Authentication, and possibly support for a DHCP Interserver Protocol and live querying of the DHCP ! database. Currently, only client classing and conditional behaviour ! have been implemented - the DNS code is waiting for an enhanced DNS ! resolver. The code has gone through a major internal restructuring ! which will help to support wider option codes, and possibly IPv6, as ! well as a more sensible memory allocation strategy. This release is ! running in producion at the ISC, but is not expected to be stable in ! the near future, and is intended for sites that are in a position to experiment, or for sites that desperately need the new features. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 17 + + - Fix a bug in the relay agent where messages to the client would be + unicast in the IP header but broadcast in the link header. The + Microsoft DHCP client would reject such packets, preventing it from + being configured. This was only a problem on non-socket-API + platforms. + + - Do not attempt to reclaim requested abandoned leases in response to + DHCPDISCOVER messages. + + - Allow the maximum lease time parameter in a host declaration to + override the maximum lease time parameter in a subnet declaration. + + - Better document the -p flag for dhclient, dhcrelay and dhcpd. + + - Apply John Wehle's patch to fix the endianness bug in the dlpi + packet filter on Solaris. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 16 + + - Fix linux man page install location. + + - Fix some confusion in the dhclient-script man page. + + - Fix error in includes/cf/linux.h that would have made network API + selections in site.h work incorrectly. + + - Fix some major stupidity in the code that figures out where or not a + client owns a particular lease. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 15 + + - Fix Makefile.conf on Linux to refer to /var/state/dhcp instead of + /var/state/dhcpd. + + - Eliminate redundant #defines in includes/cf/linux.h (for neatness). + + - Fix an obscure case where dhcpd is started by the /etc/rc system + with exactly the same pid each time, dhcpd.pid is not erased on + reboot, and therefore dhcpd would detect a server (itself) with the + pid in dhcpd.pid and decide that another server was running and + exit. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 14 + + - Install the dhcp databases in /var/state/dhcp instead of /etc or + /var/dhcpd, as suggested in the Linux Filesystem Hierarchy + Standard. + + - Fix an endianness bug in dlpi.c. As a consequence, make the + Solaris/i386 use dlpi again. + + - Fix a bunch of bugs in the Solaris client script. + + - Add some more information about Solaris to the README file. + + - Adjust startup message in interface probe so that the relay agent + and client's unattached status will not trigger questions. + + - Update some error messages to provide more help to new users for + some common mistakes. + + - Create an interface alias on Solaris when setting up IP aliases, + rather than trying to do things the *BSD way. + + - Fix a null pointer dereference bug (this time I went through the + whole function and audited it for more null pointer dereferences, + and I didn't find any, for what that's worth). + + - Don't ever release leases in response to a DHCPDISCOVER (I think + this was unlikely anyway, but why not be correct?). + + - Remove the shared-network example from the sample dhcpd.conf file. + + - Make ``make install'' make all first. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 13 + + - Support DESTDIR on installs. + + - Fix a bug in dhcp.c where a store through a null pointer would + be made under some reasonably common circumstances. + + - Add test for ARPHRD_TUNNEL so that client and server do not fail on + versions of Linux running IPsec implementations or the like. + + - Move tests for constants defined in O.S. headers into osdep.h - test + for HAVE_whatever in .c files. Define relevant HAVE_whatevers in + linux.h, so that versions of linux that define these constants as + enums will still work. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 12 + + - Initialize the "quiet" variable in dhclient.c to zero (it was used + without first having been initialized). + + - Fix the parser code for the authoritative keyword. + + - Adjust lease discovery code to NAK more aggressively for addresses + the server knows it owns. + + - Add several new messages for DHCPNAK. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 11 + + - Use DLPI only on sparcs running Solaris, since it seems not to work + on i386 boxes running Solaris for reasons yet to be determined. + + - In the client, close standard I/O descriptors when forking a daemon. + + - Don't let large lease lengths wrap lease expiry times - just use + what fits into a TIME value. + + - Fix a bug in the SIOCGIFCONF interface scanning code. + + - Fix a core dump in the interface scanner that crops up on Linux when + an interface is specified on the command line. + + - Don't use %D in strftime because egcs complains about it. + + - Print the error message if SO_BINDTODEVICE fails. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 10 + + - Update top-level Makefile so that it exits correctly on errors in + submakes under bash/gnu make (dunno which is the culprit, and don't + really care). + + - Print a more helpful message if no free BPF devices are found. + + - Add support for specifying that the server is or is not + authoritative for a particular network segment. + + - Fix two stupid typos in lpf.c. + + - Print a more helpful message if we can't create an LPF socket or + can't attach a filter to it. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 9 + + - Correct the hopelessly outdated information about Linux at the top + of the README - many apologies to the Linux people who have had to + read that nonsense for the past couple of snapshots and have been + confused or annoyed by it. I simply hadn't read it recently, and + didn't realize how out-of-date it was. + + - Print a message if the client finds no broadcast interfaces to + configure. + + - Add support for use-lease-addr-for-default-route flag in server, so + that Windows machines can be made to ARP for all addresses. + + - Update README file to mention new Linux gotchas. + + - After finally understanding Brian Murrel's code (my fault, not his) + to get interface names from /proc/net/dev on Linux, fix what I broke + of his code and document it. + + - Use sendto rather than send for SOCK_PACKET sockets, because they + can't be connected, only bound. :'( + + - Fix up SOCK_PACKET creation so that the kernel doesn't complain + about it. + + - Fix incorrect tests in linux client script: + [ $relmajor == 2 ] -> [ $relmajor -eq 2 ] + + - Make typedefs for u8, u16 and u32 types. These are Linux kernel + internal data types which are unfortunately exposed in the linux + packetfilter header file. + + - Don't include in lpf.c - it defines things we're + already correctly defining elsewhere, and doesn't define any useful + new stuff. + + - Finally fix client PREINIT bug that causes interfaces not specified + on the command line to be preinitialized. If no interfaces are + specified on the command line, all interfaces are still + preinitialized. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 8 + + - Fix socket API fallback setup code, which was causing Linux servers + and clients to loop endlessly on select when run as daemons. + + - Add support for Linux 2.2 version number (treated the same as Linux + 2.1, for now). + + - Correct apparent error in DHCPREQUEST destination address handling + when in INIT-REBOOT state. + + - Do not set BROADCAST flag if we have a valid IP address. + + - Remove hard-coded filenames and use system-specific manifest + constants. + + - Add entry and exit hooks to Linux dhclient-script (should be added + to all operating systems once tested). + + - Test for linux major and minor version so as to correctly invoke + network configuration programs. + + - Add support for Linux's gratuitous name change of bpf_insn structure + (can't pollute precious Linux sources with the "Berkeley" word, I + guess. + + - Correct USE_BPF_{SEND,RECEIVE} ifdefs for if_reinitialize_* + functions. + + - Ensure that we have ifreq structure before initializing interface - + if an interface was specified on the command line on Linux, this was + not the case. + + - Get rid of references to enstamp structure in lpf.c. Correctly + declare and initialize sock_fprog structure (aka bpf_filter + structure on non-Linux machines). + + - Define ssize_t on Ultrix. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 7 + + - Generalize FDDI support. + + - Fix potential core dump in interface discovery code. + + - Put explicit release versions on startup messages. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 6 + + - Add support for Linux Packet Filter (thanks to Brian Murrell, Interlinx). + + - Add support for FDDI hardware type. + + - Fix a long-standing bug in DLPI support where the ethertype was + being set incorrectly (thanks to Gong Wei, CCENet). + + - Don't use DLPI RAW mode on Solaris. + + - In the client, when a lease expires, the interface to which that + lease is attached is unconfigured. On systems that use the socket + API, the interface needs to then be reconfigured with the 0.0.0.0 + address so that it can be used to get a new address. + + - Add fallback support for Linux. This fixes a problem with the + relay agent when relaying over non-broadcast links, and may also fix + some obscure problems with unicasting DHCPACKs in both the server and + relay agent. + + - When allocating leases, if the oldest lease is abandoned, try to + find a younger-but-still-expired lease rather than reclaiming the + abandoned lease. + + - Add more documentation to README. + + - The absence of the /etc/dhclient.conf file is no longer considered + an error. + + - The dhcp client's lease file name can be specified on the command + line. + + - The DHCP client should no longer zap interfaces that it has not been + directed to configure. + + - If a client starts up in the init-reboot state, the xid will be a + "random" number rather than always being zero, as was previously the + case. + + - In addition to comparing transaction IDs, compare hardware addresses + in response packets to verify that they are ours. + + - Rewrite the client lease database after 20 leases have been written. + + - Fix the exponential backoff code. + + - Add a Y2k comment to indicate that something suspicious-looking is + in fact _not_ a problem. + + - Use mkstemp if possible. + + - Add missing fi in various client scripts. + + - Use "search" instead of "domain" in linux resolv.conf files. + + - Specify a hop count in all route command on solaris. + + - If an allocation fails, don't try to zero out the allocation buffer + we didn't get. + + - Support subnets that are subsets of other subnets - that is, for + example, 10.0.1.0/24 and 10.0.0.0/16. This is useful in fairly + obscure circumstances. + + - Don't set the lease end time if it's already expired. + + - Don't define INADDR_LOOPBACK on FreeBSD if it's already defined in a + system header. + + - Use the broadcast address in the relay agent if we are using the BSD + socket API. + + - Allow host declarations without names. + + - Allow the server identifier option to be specified. + + - Don't dump hostnames into the lease file if they contain + non-printable characters. + + - Copy the entire client hardware address buffer that the client sends + to the output packet, not just the portion of it that's supposedly + significant according to the hardware address length field. This + is done for the benefit of certain Microsoft clients. + + - Don't send a second ICMP echo request if we receive two DHCPDISCOVER + messages in quick succession. This prevents a rather annoying + timing race in configuring some Win95 clients. + + - Fix up dhcp-options man page to make it more readable. Note that + netbios-name-server is the same thing as WINS. CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 5 diff -rNc2 dhcp-2.0b1pl6/TODO dhcp-2.0b1pl18/TODO *** dhcp-2.0b1pl6/TODO Mon Jun 2 19:17:10 1997 --- dhcp-2.0b1pl18/TODO Wed Nov 25 08:28:00 1998 *************** *** 14,23 **** - Server-to-server protocol - - Perl scripts to convert from other DHCP and BOOTP servers' config - files to the ISC DHCPD format. - - Token ring support for bpf/nit interfaces ! - FDDI support for bpf/nit interfaces - Other network hardware support for low-level interfaces? --- 14,20 ---- - Server-to-server protocol - Token ring support for bpf/nit interfaces ! - FDDI support for bpf/nit interfaces (mostly done) - Other network hardware support for low-level interfaces? *************** *** 25,30 **** - Standard socket API for sending to all-ones broadcast and figuring out which interface a packet came in on? - - - Raw socket support for single-interface machines - IPv6/DHCPv6 support --- 22,25 ---- diff -rNc2 dhcp-2.0b1pl6/client/Makefile.dist dhcp-2.0b1pl18/client/Makefile.dist *** dhcp-2.0b1pl6/client/Makefile.dist Fri Nov 21 23:08:36 1997 --- dhcp-2.0b1pl18/client/Makefile.dist Tue Feb 23 10:09:36 1999 *************** *** 1,5 **** # Makefile.dist # ! # Copyright (c) 1996, 1997 The Internet Software Consortium. # All rights reserved. # --- 1,5 ---- # Makefile.dist # ! # Copyright (c) 1996, 1997, 1999 The Internet Software Consortium. # All rights reserved. # *************** *** 45,77 **** all: $(PROG) $(CATMANPAGES) ! install: $(PROG) $(CATMANPAGES) ! $(INSTALL) dhclient $(CLIENTBINDIR) ! $(CHMOD) 755 $(CLIENTBINDIR)/dhclient if [ x$(SCRIPT) = xnone ]; then \ echo "No client script available."; \ else \ ! $(INSTALL) scripts/$(SCRIPT) $(ETC)/dhclient-script; \ ! $(CHMOD) 700 $(ETC)/dhclient-script; \ ! fi ! if [ ! -d $(ADMMANDIR) ]; then \ ! mkdir $(ADMMANDIR); \ ! chmod 755 $(ADMMANDIR); \ ! fi ! if [ ! -d $(FFMANDIR) ]; then \ ! mkdir $(FFMANDIR); \ ! chmod 755 $(FFMANDIR); \ ! fi ! if [ ! -d $(VARDB) ]; then \ ! mkdir $(VARDB); \ ! chmod 755 $(VARDB); \ fi $(MANINSTALL) $(MANFROM) dhclient.cat8 $(MANTO) \ ! $(ADMMANDIR)/dhclient$(ADMMANEXT) $(MANINSTALL) $(MANFROM) dhclient-script.cat8 $(MANTO) \ ! $(ADMMANDIR)/dhclient-script$(ADMMANEXT) $(MANINSTALL) $(MANFROM) dhclient.conf.cat5 $(MANTO) \ ! $(FFMANDIR)/dhclient.conf$(FFMANEXT) $(MANINSTALL) $(MANFROM) dhclient.leases.cat5 $(MANTO) \ ! $(FFMANDIR)/dhclient.leases$(FFMANEXT) clean: --- 45,76 ---- all: $(PROG) $(CATMANPAGES) ! install: all ! for dir in $(CLIENTBINDIR) $(ETC) $(FFMANDIR) $(ADMMANDIR) $(VARDB); \ ! do \ ! foo=""; \ ! for bar in `echo $(DESTDIR)$${dir} |tr / ' '`; do \ ! foo=$${foo}/$$bar; \ ! if [ ! -d $$foo ]; then \ ! mkdir $$foo; \ ! chmod 755 $$foo; \ ! fi; \ ! done; \ ! done ! $(INSTALL) dhclient $(DESTDIR)$(CLIENTBINDIR) ! $(CHMOD) 755 $(DESTDIR)$(CLIENTBINDIR)/dhclient if [ x$(SCRIPT) = xnone ]; then \ echo "No client script available."; \ else \ ! $(INSTALL) scripts/$(SCRIPT) $(DESTDIR)$(ETC)/dhclient-script; \ ! $(CHMOD) 700 $(DESTDIR)$(ETC)/dhclient-script; \ fi $(MANINSTALL) $(MANFROM) dhclient.cat8 $(MANTO) \ ! $(DESTDIR)$(ADMMANDIR)/dhclient$(ADMMANEXT) $(MANINSTALL) $(MANFROM) dhclient-script.cat8 $(MANTO) \ ! $(DESTDIR)$(ADMMANDIR)/dhclient-script$(ADMMANEXT) $(MANINSTALL) $(MANFROM) dhclient.conf.cat5 $(MANTO) \ ! $(DESTDIR)$(FFMANDIR)/dhclient.conf$(FFMANEXT) $(MANINSTALL) $(MANFROM) dhclient.leases.cat5 $(MANTO) \ ! $(DESTDIR)$(FFMANDIR)/dhclient.leases$(FFMANEXT) clean: diff -rNc2 dhcp-2.0b1pl6/client/clparse.c dhcp-2.0b1pl18/client/clparse.c *** dhcp-2.0b1pl6/client/clparse.c Thu Jun 25 14:11:27 1998 --- dhcp-2.0b1pl18/client/clparse.c Fri Jul 10 16:17:00 1998 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: clparse.c,v 1.13.2.1 1998/06/25 21:11:27 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: clparse.c,v 1.13.2.2 1998/07/10 23:17:00 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 113,126 **** = sizeof requested_lease_time; ! if ((cfile = fopen (path_dhclient_conf, "r")) == NULL) ! error ("Can't open %s: %m", path_dhclient_conf); ! do { ! token = peek_token (&val, cfile); ! if (token == EOF) ! break; ! parse_client_statement (cfile, (struct interface_info *)0, ! &top_level_config); ! } while (1); ! token = next_token (&val, cfile); /* Clear the peek buffer */ /* Set up state and config structures for clients that don't --- 113,128 ---- = sizeof requested_lease_time; ! if ((cfile = fopen (path_dhclient_conf, "r")) != NULL) { ! do { ! token = peek_token (&val, cfile); ! if (token == EOF) ! break; ! parse_client_statement (cfile, ! (struct interface_info *)0, ! &top_level_config); ! } while (1); ! token = next_token (&val, cfile); /* Clear the peek buffer */ ! fclose (cfile); ! } /* Set up state and config structures for clients that don't diff -rNc2 dhcp-2.0b1pl6/client/dhclient-script.8 dhcp-2.0b1pl18/client/dhclient-script.8 *** dhcp-2.0b1pl6/client/dhclient-script.8 Fri Nov 21 23:09:37 1997 --- dhcp-2.0b1pl18/client/dhclient-script.8 Sat Feb 27 13:41:42 1999 *************** *** 56,60 **** .B ETCDIR/dhclient.conf script. If you find that you can't make such a customization without ! customizing dhclient.conf, please submit a bug report. .SH OPERATION When dhclient needs to invoke the client configuration script, it --- 56,60 ---- .B ETCDIR/dhclient.conf script. If you find that you can't make such a customization without ! customizing dhclient-script, please submit a bug report. .SH OPERATION When dhclient needs to invoke the client configuration script, it *************** *** 90,94 **** .SH ARPCHECK The DHCP client wants to know if a response to the ARP request send ! using ARPCHECK has been received. If one has, the script should exit with a nonzero status, indicating that the offered address has already been requested and should be declined. $new_ip_address and --- 90,94 ---- .SH ARPCHECK The DHCP client wants to know if a response to the ARP request send ! using ARPSEND has been received. If one has, the script should exit with a nonzero status, indicating that the offered address has already been requested and should be declined. $new_ip_address and diff -rNc2 dhcp-2.0b1pl6/client/dhclient-script.cat8 dhcp-2.0b1pl18/client/dhclient-script.cat8 *** dhcp-2.0b1pl6/client/dhclient-script.cat8 Fri Nov 21 23:04:24 1997 --- dhcp-2.0b1pl18/client/dhclient-script.cat8 Sat Feb 27 13:41:51 1999 *************** *** 27,31 **** computer should be done in the //eettcc//ddhhcclliieenntt..ccoonnff script. If you find that you can't make such a customization with­ ! out customizing dhclient.conf, please submit a bug report. OOPPEERRAATTIIOONN --- 27,32 ---- computer should be done in the //eettcc//ddhhcclliieenntt..ccoonnff script. If you find that you can't make such a customization with­ ! out customizing dhclient-script, please submit a bug ! report. OOPPEERRAATTIIOONN *************** *** 58,62 **** address will be passed in $alias_ip_address, and that ip alias should be deleted from the interface, along with any - routes to it. --- 59,62 ---- *************** *** 71,74 **** --- 71,76 ---- + routes to it. + AARRPPSSEENNDD The DHCP client is requesting that an address that has *************** *** 82,86 **** AARRPPCCHHEECCKK The DHCP client wants to know if a response to the ARP ! request send using ARPCHECK has been received. If one has, the script should exit with a nonzero status, indi­ cating that the offered address has already been requested --- 84,88 ---- AARRPPCCHHEECCKK The DHCP client wants to know if a response to the ARP ! request send using ARPSEND has been received. If one has, the script should exit with a nonzero status, indi­ cating that the offered address has already been requested *************** *** 123,128 **** starting with $new_, there is another set of variables starting with $old_. Persistent settings that may have - changed need to be deleted - for example, if a local route - to the bound address is being configured, the old local --- 125,128 ---- *************** *** 137,140 **** --- 137,142 ---- + changed need to be deleted - for example, if a local route + to the bound address is being configured, the old local route should be deleted. If the default route has changed, the old default route should be deleted. If the *************** *** 188,194 **** file, although the script files for similar operating sys­ tems may be similar or even identical. The script files ! included in the Internet Software Consortium DHCP distri­ ! bution appear in the distribution tree under ! client/scripts, and bear the names of the operating --- 190,194 ---- file, although the script files for similar operating sys­ tems may be similar or even identical. The script files ! included in the Internet Software Consortium DHCP *************** *** 203,207 **** ! systems on which they are intended to work. BBUUGGSS --- 203,209 ---- ! distribution appear in the distribution tree under ! client/scripts, and bear the names of the operating sys­ ! tems on which they are intended to work. BBUUGGSS *************** *** 227,232 **** To learn more about Vixie Enterprises, see hhttttpp::////wwwwww..vviixx..ccoomm.. - - --- 229,232 ---- diff -rNc2 dhcp-2.0b1pl6/client/dhclient.8 dhcp-2.0b1pl18/client/dhclient.8 *** dhcp-2.0b1pl6/client/dhclient.8 Wed Oct 29 10:35:02 1997 --- dhcp-2.0b1pl18/client/dhclient.8 Fri Mar 5 08:04:52 1999 *************** *** 122,125 **** --- 122,137 ---- flag may used. It should be followed by the udp port number that dhclient should use. This is mostly useful for debugging purposes. + If the + .B -p + flag is specified, the client will transmit responses to servers at a + port number that is one less than the one specified - i.e., if you + specify + .B -p + 68, then the client will listen on port 68 and transmit to port 67. + Datagrams that must go through relay agents are sent to the port + number specified with the + .B -p + flag - if you wish to use alternate port numbers, you must configure + any relay agents you are using to use the same alternate port numbers. .PP Dhclient will normally run in the foreground until it has configured diff -rNc2 dhcp-2.0b1pl6/client/dhclient.c dhcp-2.0b1pl18/client/dhclient.c *** dhcp-2.0b1pl6/client/dhclient.c Sat Dec 6 03:24:31 1997 --- dhcp-2.0b1pl18/client/dhclient.c Fri Mar 5 08:13:54 1999 *************** *** 4,9 **** /* ! * Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. ! * All rights reserved. * * Redistribution and use in source and binary forms, with or without --- 4,9 ---- /* ! * Copyright (c) 1995, 1996, 1997, 1998, 1999 ! * The Internet Software Consortium. All rights reserved. * * Redistribution and use in source and binary forms, with or without *************** *** 56,61 **** #ifndef lint ! static char copyright[] = ! "$Id: dhclient.c,v 1.44.2.1 1997/12/06 11:24:31 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 56,61 ---- #ifndef lint ! static char ocopyright[] = ! "$Id: dhclient.c,v 1.44.2.25 1999/03/05 16:13:54 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 84,91 **** #define ASSERT_STATE(state_is, state_shouldbe) {} - #ifdef USE_FALLBACK - struct interface_info fallback_interface; - #endif - u_int16_t local_port; u_int16_t remote_port; --- 84,87 ---- *************** *** 94,97 **** --- 90,100 ---- int save_scripts; + static char copyright[] = + "Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium."; + static char arr [] = "All rights reserved."; + static char message [] = "Internet Software Consortium DHCP Client V2.0b1pl18"; + static char contrib [] = "\nPlease contribute if you find this software useful."; + static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html\n"; + static void usage PROTO ((void)); *************** *** 104,107 **** --- 107,111 ---- struct interface_info *ip; int seed; + int quiet = 0; #ifdef SYSLOG_4_2 *************** *** 127,130 **** --- 131,141 ---- } else if (!strcmp (argv [i], "-D")) { save_scripts = 1; + } else if (!strcmp (argv [i], "-lf")) { + if (++i == argc) + usage (); + path_dhclient_db = argv [i]; + } else if (!strcmp (argv [i], "-q")) { + quiet = 1; + quiet_interface_discovery = 1; } else if (argv [i][0] == '-') { usage (); *************** *** 144,147 **** --- 155,167 ---- } } + + if (!quiet) { + note (message); + note (copyright); + note (arr); + note (contrib); + note (url); + } + /* Default to the DHCP/BOOTP port. */ if (!local_port) { *************** *** 187,190 **** --- 207,211 ---- script_go ((struct interface_info *)0); + note ("No broadcast interfaces found - exiting."); /* Nothing more to do. */ exit (0); *************** *** 192,195 **** --- 213,223 ---- /* Call the script with the list of interfaces. */ for (ip = interfaces; ip; ip = ip -> next) { + /* If interfaces were specified, don't configure + interfaces that weren't specified! */ + if (interfaces_requested && + ((ip -> flags & (INTERFACE_REQUESTED | + INTERFACE_AUTOMATIC)) != + INTERFACE_REQUESTED)) + continue; script_init (ip, "PREINIT", (struct string_list *)0); if (ip -> client -> alias) *************** *** 241,245 **** static void usage () { ! error ("Usage: dhclient [-c] [-p ] [interface]"); } --- 269,273 ---- static void usage () { ! error ("Usage: dhclient [-c] [-p ] [-lf lease-file] [interface]"); } *************** *** 292,299 **** ip -> client -> state = S_REBOOTING; /* Make a DHCPREQUEST packet, and set appropriate per-interface flags. */ make_request (ip, ip -> client -> active); - ip -> client -> xid = ip -> client -> packet.xid; ip -> client -> destination = iaddr_broadcast; ip -> client -> first_sending = cur_time; --- 320,331 ---- ip -> client -> state = S_REBOOTING; + /* make_request doesn't initialize xid because it normally comes + from the DHCPDISCOVER, but we haven't sent a DHCPDISCOVER, + so pick an xid now. */ + ip -> client -> xid = random (); + /* Make a DHCPREQUEST packet, and set appropriate per-interface flags. */ make_request (ip, ip -> client -> active); ip -> client -> destination = iaddr_broadcast; ip -> client -> first_sending = cur_time; *************** *** 433,437 **** /* If we're not receptive to an offer right now, or if the offer has an unrecognizable transaction id, then just drop it. */ ! if (packet -> interface -> client -> xid != packet -> raw -> xid) { debug ("DHCPACK in wrong transaction."); return; --- 465,473 ---- /* If we're not receptive to an offer right now, or if the offer has an unrecognizable transaction id, then just drop it. */ ! if (packet -> interface -> client -> xid != packet -> raw -> xid || ! (packet -> interface -> hw_address.hlen != ! packet -> raw -> hlen) || ! (memcmp (packet -> interface -> hw_address.haddr, ! packet -> raw -> chaddr, packet -> raw -> hlen))) { debug ("DHCPACK in wrong transaction."); return; *************** *** 463,466 **** --- 499,506 ---- getULong (ip -> client -> new -> options [DHO_DHCP_LEASE_TIME].data); + /* A number that looks negative here is really just very large, + because the lease expiry offset is unsigned. */ + if (ip -> client -> new -> expiry < 0) + ip -> client -> new -> expiry = TIME_MAX; /* Take the server-provided renewal time if there is one; *************** *** 486,491 **** --- 526,538 ---- ip -> client -> new -> expiry += cur_time; + /* Lease lengths can never be negative. */ + if (ip -> client -> new -> expiry < cur_time) + ip -> client -> new -> expiry = TIME_MAX; ip -> client -> new -> renewal += cur_time; + if (ip -> client -> new -> renewal < cur_time) + ip -> client -> new -> renewal = TIME_MAX; ip -> client -> new -> rebind += cur_time; + if (ip -> client -> new -> rebind < cur_time) + ip -> client -> new -> rebind = TIME_MAX; bind_lease (ip); *************** *** 499,503 **** /* Write out the new lease. */ ! write_client_lease (ip, ip -> client -> new); /* Run the client script with the new parameters. */ --- 546,550 ---- /* Write out the new lease. */ ! write_client_lease (ip, ip -> client -> new, 0); /* Run the client script with the new parameters. */ *************** *** 663,667 **** has an unrecognizable transaction id, then just drop it. */ if (ip -> client -> state != S_SELECTING || ! packet -> interface -> client -> xid != packet -> raw -> xid) { debug ("%s in wrong transaction.", name); return; --- 710,718 ---- has an unrecognizable transaction id, then just drop it. */ if (ip -> client -> state != S_SELECTING || ! packet -> interface -> client -> xid != packet -> raw -> xid || ! (packet -> interface -> hw_address.hlen != ! packet -> raw -> hlen) || ! (memcmp (packet -> interface -> hw_address.haddr, ! packet -> raw -> chaddr, packet -> raw -> hlen))) { debug ("%s in wrong transaction.", name); return; *************** *** 862,866 **** /* If we're not receptive to an offer right now, or if the offer has an unrecognizable transaction id, then just drop it. */ ! if (packet -> interface -> client -> xid != packet -> raw -> xid) { debug ("DHCPNAK in wrong transaction."); return; --- 913,921 ---- /* If we're not receptive to an offer right now, or if the offer has an unrecognizable transaction id, then just drop it. */ ! if (packet -> interface -> client -> xid != packet -> raw -> xid || ! (packet -> interface -> hw_address.hlen != ! packet -> raw -> hlen) || ! (memcmp (packet -> interface -> hw_address.haddr, ! packet -> raw -> chaddr, packet -> raw -> hlen))) { debug ("DHCPNAK in wrong transaction."); return; *************** *** 964,969 **** ip -> client -> interval = ((ip -> client -> config -> backoff_cutoff / 2) ! + ((random () >> 2) ! % ip -> client -> interval)); } else if (!ip -> client -> interval) ip -> client -> interval = --- 1019,1024 ---- ip -> client -> interval = ((ip -> client -> config -> backoff_cutoff / 2) ! + ((random () >> 2) % ! ip -> client -> config -> backoff_cutoff)); } else if (!ip -> client -> interval) ip -> client -> interval = *************** *** 995,1000 **** inaddr_any, &sockaddr_broadcast, (struct hardware *)0); - if (result < 0) - warn ("send_packet: %m"); add_timeout (cur_time + ip -> client -> interval, send_discover, ip); --- 1050,1053 ---- *************** *** 1162,1165 **** --- 1215,1226 ---- script_go (ip); + /* Now do a preinit on the interface so that we can + discover a new address. */ + script_init (ip, "PREINIT", (struct string_list *)0); + if (ip -> client -> alias) + script_write_params (ip, "alias_", + ip -> client -> alias); + script_go (ip); + ip -> client -> state = S_INIT; state_init (ip); *************** *** 1196,1199 **** --- 1257,1261 ---- broadcast the DHCPREQUEST rather than unicasting. */ if (ip -> client -> state == S_REQUESTING || + ip -> client -> state == S_REBOOTING || cur_time > ip -> client -> active -> rebind) destination.sin_addr.s_addr = INADDR_BROADCAST; *************** *** 1224,1237 **** ntohs (destination.sin_port)); ! #ifdef USE_FALLBACK ! if (destination.sin_addr.s_addr != INADDR_BROADCAST) ! result = send_fallback (&fallback_interface, ! (struct packet *)0, ! &ip -> client -> packet, ! ip -> client -> packet_length, ! from, &destination, ! (struct hardware *)0); else - #endif /* USE_FALLBACK */ /* Send out a packet. */ result = send_packet (ip, (struct packet *)0, --- 1286,1298 ---- ntohs (destination.sin_port)); ! if (destination.sin_addr.s_addr != INADDR_BROADCAST && ! fallback_interface) ! result = send_packet (fallback_interface, ! (struct packet *)0, ! &ip -> client -> packet, ! ip -> client -> packet_length, ! from, &destination, ! (struct hardware *)0); else /* Send out a packet. */ result = send_packet (ip, (struct packet *)0, *************** *** 1241,1247 **** (struct hardware *)0); - if (result < 0) - warn ("send_packet: %m"); - add_timeout (cur_time + ip -> client -> interval, send_request, ip); --- 1302,1305 ---- *************** *** 1265,1270 **** inaddr_any, &sockaddr_broadcast, (struct hardware *)0); - if (result < 0) - warn ("send_packet: %m"); } --- 1323,1326 ---- *************** *** 1286,1291 **** inaddr_any, &sockaddr_broadcast, (struct hardware *)0); - if (result < 0) - warn ("send_packet: %m"); } --- 1342,1345 ---- *************** *** 1474,1478 **** ip -> client -> packet.xid = ip -> client -> xid; ip -> client -> packet.secs = 0; /* Filled in by send_request. */ - ip -> client -> packet.flags = htons (BOOTP_BROADCAST); /* If we own the address we're requesting, put it in ciaddr; --- 1528,1531 ---- *************** *** 1480,1489 **** if (ip -> client -> state == S_BOUND || ip -> client -> state == S_RENEWING || ! ip -> client -> state == S_REBINDING) memcpy (&ip -> client -> packet.ciaddr, lease -> address.iabuf, lease -> address.len); ! else memset (&ip -> client -> packet.ciaddr, 0, sizeof ip -> client -> packet.ciaddr); memset (&ip -> client -> packet.yiaddr, 0, --- 1533,1545 ---- if (ip -> client -> state == S_BOUND || ip -> client -> state == S_RENEWING || ! ip -> client -> state == S_REBINDING) { memcpy (&ip -> client -> packet.ciaddr, lease -> address.iabuf, lease -> address.len); ! ip -> client -> packet.flags = 0; ! } else { memset (&ip -> client -> packet.ciaddr, 0, sizeof ip -> client -> packet.ciaddr); + ip -> client -> packet.flags = htons (BOOTP_BROADCAST); + } memset (&ip -> client -> packet.yiaddr, 0, *************** *** 1637,1641 **** ip -> client -> packet.hlen = ip -> hw_address.hlen; ip -> client -> packet.hops = 0; ! ip -> client -> packet.xid = ip -> client -> packet.xid; ip -> client -> packet.secs = 0; ip -> client -> packet.flags = 0; --- 1693,1697 ---- ip -> client -> packet.hlen = ip -> hw_address.hlen; ip -> client -> packet.hops = 0; ! ip -> client -> packet.xid = random (); ip -> client -> packet.secs = 0; ip -> client -> packet.flags = 0; *************** *** 1685,1689 **** leaseFile = fopen (path_dhclient_db, "w"); if (!leaseFile) ! error ("can't create /var/db/dhclient.leases: %m"); /* Write out all the leases attached to configured interfaces that --- 1741,1745 ---- leaseFile = fopen (path_dhclient_db, "w"); if (!leaseFile) ! error ("can't create %s: %m", path_dhclient_db); /* Write out all the leases attached to configured interfaces that *************** *** 1691,1698 **** for (ip = interfaces; ip; ip = ip -> next) { for (lp = ip -> client -> leases; lp; lp = lp -> next) { ! write_client_lease (ip, lp); } if (ip -> client -> active) ! write_client_lease (ip, ip -> client -> active); } --- 1747,1754 ---- for (ip = interfaces; ip; ip = ip -> next) { for (lp = ip -> client -> leases; lp; lp = lp -> next) { ! write_client_lease (ip, lp, 1); } if (ip -> client -> active) ! write_client_lease (ip, ip -> client -> active, 1); } *************** *** 1701,1718 **** for (ip = dummy_interfaces; ip; ip = ip -> next) { for (lp = ip -> client -> leases; lp; lp = lp -> next) { ! write_client_lease (ip, lp); } if (ip -> client -> active) ! write_client_lease (ip, ip -> client -> active); } fflush (leaseFile); } ! void write_client_lease (ip, lease) struct interface_info *ip; struct client_lease *lease; { int i; struct tm *t; /* If the lease came from the config file, we don't need to stash --- 1757,1783 ---- for (ip = dummy_interfaces; ip; ip = ip -> next) { for (lp = ip -> client -> leases; lp; lp = lp -> next) { ! write_client_lease (ip, lp, 1); } if (ip -> client -> active) ! write_client_lease (ip, ip -> client -> active, 1); } fflush (leaseFile); } ! void write_client_lease (ip, lease, rewrite) struct interface_info *ip; struct client_lease *lease; + int rewrite; { int i; struct tm *t; + static int leases_written; + + if (!rewrite) { + if (leases_written++ > 20) { + rewrite_client_leases (); + leases_written = 0; + } + } /* If the lease came from the config file, we don't need to stash *************** *** 1724,1728 **** leaseFile = fopen (path_dhclient_db, "w"); if (!leaseFile) ! error ("can't create /var/db/dhclient.leases: %m"); } --- 1789,1793 ---- leaseFile = fopen (path_dhclient_db, "w"); if (!leaseFile) ! error ("can't create %s: %m", path_dhclient_db); } *************** *** 1752,1755 **** --- 1817,1824 ---- } } + + /* Note: the following is not a Y2K bug - it's a Y1.9K bug. Until + somebody invents a time machine, I think we can safely disregard + it. */ t = gmtime (&lease -> renewal); fprintf (leaseFile, *************** *** 1794,1798 **** fd = mkstemp (scriptName); #else ! mktemp (scriptName); fd = creat (scriptName, 0600); } while (fd < 0); --- 1863,1869 ---- fd = mkstemp (scriptName); #else ! if (!mktemp (scriptName)) ! error ("can't create temporary client script %s: %m", ! scriptName); fd = creat (scriptName, 0600); } while (fd < 0); *************** *** 2027,2030 **** --- 2098,2106 ---- /* Become session leader and get pid... */ pid = setsid (); + + /* Close standard I/O descriptors. */ + close(0); + close(1); + close(2); write_client_pid_file (); diff -rNc2 dhcp-2.0b1pl6/client/scripts/bsdos dhcp-2.0b1pl18/client/scripts/bsdos *** dhcp-2.0b1pl6/client/scripts/bsdos Fri Nov 21 22:15:01 1997 --- dhcp-2.0b1pl18/client/scripts/bsdos Fri Jul 10 16:07:32 1998 *************** *** 156,159 **** --- 156,160 ---- exit 0 fi + fi ifconfig $interface inet -alias $new_ip_address $medium for router in $old_routers; do diff -rNc2 dhcp-2.0b1pl6/client/scripts/freebsd dhcp-2.0b1pl18/client/scripts/freebsd *** dhcp-2.0b1pl6/client/scripts/freebsd Fri Nov 21 22:15:00 1997 --- dhcp-2.0b1pl18/client/scripts/freebsd Fri Jul 10 16:07:33 1998 *************** *** 156,159 **** --- 156,160 ---- exit 0 fi + fi ifconfig $interface inet -alias $new_ip_address $medium for router in $old_routers; do diff -rNc2 dhcp-2.0b1pl6/client/scripts/linux dhcp-2.0b1pl18/client/scripts/linux *** dhcp-2.0b1pl6/client/scripts/linux Sun May 17 22:29:23 1998 --- dhcp-2.0b1pl18/client/scripts/linux Fri Feb 5 12:15:48 1999 *************** *** 1,4 **** --- 1,5 ---- #!/bin/sh # dhclient-script for Linux. Dan Halbert, March, 1997. + # Updated for Linux 2.[12] by Brian J. Murrell, January 1999. # No guarantees about this. I'm a novice at the details of Linux # networking. *************** *** 22,25 **** --- 23,52 ---- # of the $1 in its args. + # Must be used on exit. Invokes the local dhcp client exit hooks, if any. + function exit_with_hooks() { + exit_status=$1 + if [ -x /etc/dhclient-exit-hooks ]; then + . /etc/dhclient-exit-hooks + fi + # probably should do something with exit status of the local script + exit $exit_status + } + + # Invoke the local dhcp client enter hooks, if they exist. + if [ -x /etc/dhclient-enter-hooks ]; then + exit_status=0 + . /etc/dhclient-enter-hooks + # allow the local script to abort processing of this state + # local script must set exit_status variable to nonzero. + if [ $exit_status -ne 0 ]; then + exit $exit_status + fi + fi + + release=`uname -r` + release=`expr $release : '\(.*\)\..*'` + relmajor=`echo $release |sed -e 's/^\([^\.]*\)\..*$/\1/'` + relminor=`echo $release |sed -e 's/^.*\.\([^\.]*\)$/\1/'` + if [ x$new_broadcast_address != x ]; then new_broadcast_arg="broadcast $new_broadcast_address" *************** *** 40,44 **** if [ x$reason = xMEDIUM ]; then # Linux doesn't do mediums (ok, ok, media). ! exit 0 fi --- 67,71 ---- if [ x$reason = xMEDIUM ]; then # Linux doesn't do mediums (ok, ok, media). ! exit_with_hooks 0 fi *************** *** 48,60 **** ifconfig $interface:0- inet 0 fi ! ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \ broadcast 255.255.255.255 up ! # Add route to make broadcast work. Do not omit netmask. ! route add default dev $interface netmask 0.0.0.0 ! exit 0 fi if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then ! exit 0; fi --- 75,96 ---- ifconfig $interface:0- inet 0 fi ! if [ $relmajor -lt 2 ] || ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ) ! then ! ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \ broadcast 255.255.255.255 up ! # Add route to make broadcast work. Do not omit netmask. ! route add default dev $interface netmask 0.0.0.0 ! else ! ifconfig $interface up ! fi ! ! # We need to give the kernel some time to get the interface up. ! sleep 1 ! ! exit_with_hooks 0 fi if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then ! exit_with_hooks 0 fi *************** *** 76,82 **** ifconfig $interface inet $new_ip_address $new_subnet_arg \ ! $new_broadcast_arg # Add a network route to the computed network address. ! route add -net $new_network_number $new_subnet_arg dev $interface for router in $new_routers; do route add default gw $router --- 112,121 ---- ifconfig $interface inet $new_ip_address $new_subnet_arg \ ! $new_broadcast_arg # Add a network route to the computed network address. ! if [ $relmajor -lt 2 ] || \ ! ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then ! route add -net $new_network_number $new_subnet_arg dev $interface ! fi for router in $new_routers; do route add default gw $router *************** *** 89,97 **** route add -host $alias_ip_address $interface:0 fi ! echo domain $new_domain_name >/etc/resolv.conf for nameserver in $new_domain_name_servers; do echo nameserver $nameserver >>/etc/resolv.conf done ! exit 0 fi --- 128,136 ---- route add -host $alias_ip_address $interface:0 fi ! echo search $new_domain_name >/etc/resolv.conf for nameserver in $new_domain_name_servers; do echo nameserver $nameserver >>/etc/resolv.conf done ! exit_with_hooks 0 fi *************** *** 109,113 **** route add -host $alias_ip_address $interface:0 fi ! exit 0 fi --- 148,152 ---- route add -host $alias_ip_address $interface:0 fi ! exit_with_hooks 0 fi *************** *** 120,124 **** set $new_routers ############## what is -w in ping? ! if ping -q -c 1 -w 1 $1; then if [ x$new_ip_address != x$alias_ip_address ] && \ [ x$alias_ip_address != x ]; then --- 159,163 ---- set $new_routers ############## what is -w in ping? ! if ping -q -c 1 $1; then if [ x$new_ip_address != x$alias_ip_address ] && \ [ x$alias_ip_address != x ]; then *************** *** 126,134 **** route add -host $alias_ip_address dev $interface:0 fi ! route add -net $new_network_number for router in $new_routers; do route add default gw $router done ! echo domain $new_domain_name >/etc/resolv.conf.std for nameserver in $new_domain_name_servers; do echo nameserver $nameserver >>/etc/resolv.conf.std --- 165,176 ---- route add -host $alias_ip_address dev $interface:0 fi ! if [ $relmajor -lt 2 ] || \ ! ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then ! route add -net $new_network_number ! fi for router in $new_routers; do route add default gw $router done ! echo search $new_domain_name >/etc/resolv.conf.std for nameserver in $new_domain_name_servers; do echo nameserver $nameserver >>/etc/resolv.conf.std *************** *** 138,146 **** ln /etc/resolv.conf.std /etc/resolv.conf fi ! exit 0 fi ifconfig $interface inet down ! exit 1 fi ! exit 0 --- 180,188 ---- ln /etc/resolv.conf.std /etc/resolv.conf fi ! exit_with_hooks 0 fi ifconfig $interface inet down ! exit_with_hooks 1 fi ! exit_with_hooks 0 diff -rNc2 dhcp-2.0b1pl6/client/scripts/netbsd dhcp-2.0b1pl18/client/scripts/netbsd *** dhcp-2.0b1pl6/client/scripts/netbsd Fri Nov 21 22:14:34 1997 --- dhcp-2.0b1pl18/client/scripts/netbsd Fri Mar 5 08:27:40 1999 *************** *** 1,4 **** --- 1,32 ---- #!/bin/sh + function make_resolv_conf() { + echo search $new_domain_name >/etc/resolv.conf + for nameserver in $new_domain_name_servers; do + echo nameserver $nameserver >>/etc/resolv.conf + done + } + + # Must be used on exit. Invokes the local dhcp client exit hooks, if any. + function exit_with_hooks() { + exit_status=$1 + if [ -x /etc/dhclient-exit-hooks ]; then + . /etc/dhclient-exit-hooks + fi + # probably should do something with exit status of the local script + exit $exit_status + } + + # Invoke the local dhcp client enter hooks, if they exist. + if [ -x /etc/dhclient-enter-hooks ]; then + exit_status=0 + . /etc/dhclient-enter-hooks + # allow the local script to abort processing of this state + # local script must set exit_status variable to nonzero. + if [ $exit_status -ne 0 ]; then + exit $exit_status + fi + fi + if [ x$new_network_number != x ]; then echo New Network Number: $new_network_number *************** *** 26,30 **** ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1 sleep 1 ! exit 0 fi --- 54,58 ---- ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1 sleep 1 ! exit_with_hooks 0 fi *************** *** 36,44 **** ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \ broadcast 255.255.255.255 up ! exit 0 fi if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then ! exit 0; fi --- 64,72 ---- ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \ broadcast 255.255.255.255 up ! exit_with_hooks 0 fi if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then ! exit_with_hooks 0 fi *************** *** 86,94 **** route add $alias_ip_address 127.0.0.1 fi ! echo search $new_domain_name >/etc/resolv.conf ! for nameserver in $new_domain_name_servers; do ! echo nameserver $nameserver >>/etc/resolv.conf ! done ! exit 0 fi --- 114,119 ---- route add $alias_ip_address 127.0.0.1 fi ! make_resolv_conf ! exit_with_hooks 0 fi *************** *** 118,122 **** route add $alias_ip_address 127.0.0.1 fi ! exit 0 fi --- 143,147 ---- route add $alias_ip_address 127.0.0.1 fi ! exit_with_hooks 0 fi *************** *** 146,159 **** shift; shift done ! echo search $new_domain_name >/etc/resolv.conf.std ! for nameserver in $new_domain_name_servers; do ! echo nameserver $nameserver >>/etc/resolv.conf.std ! done ! if [ -f /etc/resolv.conf ]; then ! rm -f /etc/resolv.conf ! fi ! mv /etc/resolv.conf.std /etc/resolv.conf ! exit 0 fi ifconfig $interface inet -alias $new_ip_address $medium for router in $old_routers; do --- 171,178 ---- shift; shift done ! make_resolv_conf ! exit_with_hooks 0 fi + fi ifconfig $interface inet -alias $new_ip_address $medium for router in $old_routers; do *************** *** 169,174 **** arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \ |sh >/dev/null 2>&1 ! exit 1 fi ! exit 0 --- 188,193 ---- arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \ |sh >/dev/null 2>&1 ! exit_with_hooks 1 fi ! exit_with_hooks 0 diff -rNc2 dhcp-2.0b1pl6/client/scripts/solaris dhcp-2.0b1pl18/client/scripts/solaris *** dhcp-2.0b1pl6/client/scripts/solaris Mon Jun 2 17:19:55 1997 --- dhcp-2.0b1pl18/client/scripts/solaris Tue Feb 23 13:52:53 1999 *************** *** 17,30 **** fi ! # For Solaris, ifconfig lives in /sbin ! OS=`uname -r` ! if [ $OS = "5.5.1" ]; then ! PATH=/sbin:$PATH ! fi if [ x$reason = xMEDIUM ]; then ! ifconfig $interface $medium ! ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1 ! ifconfig $interface sleep 1 exit 0 --- 17,30 ---- fi ! ifconfig=/sbin/ifconfig ! ! release=`uname -r` ! release=`expr $release : '\(.*\)\..*'` ! relmajor=`echo $release |sed -e 's/^\([^\.]*\)\..*$/\1/'` ! relminor=`echo $release |sed -e 's/^.*\.\([^\.]*\)$/\1/'` if [ x$reason = xMEDIUM ]; then ! $ifconfig $interface $medium ! $ifconfig $interface sleep 1 exit 0 *************** *** 33,45 **** if [ x$reason = xPREINIT ]; then if [ x$alias_ip_address != x ]; then ! 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 ! if [ $OS = "5.5.1" ]; then # Turn the interface on ! ifconfig $interface plumb ! ifconfig $interface inet 10.0.0.1 up else ! ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \ broadcast 255.255.255.255 up fi --- 33,46 ---- if [ x$reason = xPREINIT ]; then if [ x$alias_ip_address != x ]; then ! $ifconfig ${interface}:1 0 down > /dev/null 2>&1 route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1 fi ! if [ $relmajor -gt 5 ] || ( [ $relmajor -eq 5 ] && [ $relminor -ge 5 ] ) ! then # Turn the interface on ! $ifconfig $interface plumb ! $ifconfig $interface up else ! $ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \ broadcast 255.255.255.255 up fi *************** *** 55,63 **** if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \ [ x$alias_ip_address != x$old_ip_address ]; then ! 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 if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then ! 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 --- 56,64 ---- if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \ [ x$alias_ip_address != x$old_ip_address ]; then ! $ifconfig ${interface}:1 inet 0 down > /dev/null 2>&1 route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1 fi if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then ! $ifconfig ${interface} inet 0 down route delete $old_ip_address 127.1 >/dev/null 2>&1 for router in $old_routers; do *************** *** 68,82 **** 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 ! 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 done fi if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; then ! ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg ! route add $alias_ip_address 127.0.0.1 fi echo search $new_domain_name >/etc/resolv.conf --- 69,83 ---- 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 ! route add $new_ip_address 127.1 1 >/dev/null 2>&1 for router in $new_routers; do ! route add default $router 1 >/dev/null 2>&1 done fi if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ]; then ! $ifconfig ${interface}:1 inet $alias_ip_address $alias_subnet_arg ! route add $alias_ip_address 127.0.0.1 1 fi echo search $new_domain_name >/etc/resolv.conf *************** *** 89,107 **** if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then if [ x$alias_ip_address != x ]; then ! 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 if [ x$old_ip_address != x ]; then ! 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 done ! arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p'i \ |sh >/dev/null 2>&1 fi if [ x$alias_ip_address != x ]; then ! ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg ! route add $alias_ip_address 127.0.0.1 fi exit 0 --- 90,108 ---- if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then if [ x$alias_ip_address != x ]; then ! $ifconfig ${interface}:1 0 down > /dev/null 2>&1 route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1 fi if [ x$old_ip_address != x ]; then ! $ifconfig $interface inet 0 down 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 done ! arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \ |sh >/dev/null 2>&1 fi if [ x$alias_ip_address != x ]; then ! $ifconfig ${interface}:1 inet $alias_ip_address $alias_subnet_arg ! route add $alias_ip_address 127.0.0.1 1 fi exit 0 *************** *** 110,129 **** if [ x$reason = xTIMEOUT ]; then if [ x$alias_ip_address != x ]; then ! 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 sleep 1 set $new_routers ! if ping -c 1 -w 1 $1; then if [ x$new_ip_address != x$alias_ip_address ] && \ [ x$alias_ip_address != x ]; then ! ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg ! route add $alias_ip_address 127.0.0.1 fi ! 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 done echo search $new_domain_name >/etc/resolv.conf.std --- 111,130 ---- if [ x$reason = xTIMEOUT ]; then if [ x$alias_ip_address != x ]; then ! $ifconfig ${interface}:1 0 down > /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 sleep 1 set $new_routers ! if ping -s -n -I 1 $1 64 1; then if [ x$new_ip_address != x$alias_ip_address ] && \ [ x$alias_ip_address != x ]; then ! $ifconfig ${interface}:1 inet $alias_ip_address $alias_subnet_arg ! route add $alias_ip_address 127.0.0.1 1 fi ! route add $new_ip_address 127.1 1 >/dev/null 2>&1 for router in $new_routers; do ! route add default $router 1 >/dev/null 2>&1 done echo search $new_domain_name >/etc/resolv.conf.std *************** *** 137,141 **** exit 0 fi ! ifconfig $interface inet -alias $new_ip_address $medium for router in $old_routers; do route delete default $router >/dev/null 2>&1 --- 138,142 ---- exit 0 fi ! $ifconfig $interface inet 0 down for router in $old_routers; do route delete default $router >/dev/null 2>&1 diff -rNc2 dhcp-2.0b1pl6/common/Makefile.dist dhcp-2.0b1pl18/common/Makefile.dist *** dhcp-2.0b1pl6/common/Makefile.dist Wed Jun 24 23:07:12 1998 --- dhcp-2.0b1pl18/common/Makefile.dist Tue Feb 23 10:09:36 1999 *************** *** 1,5 **** # Makefile.dist # ! # Copyright (c) 1996 The Internet Software Consortium. All rights reserved. # # Redistribution and use in source and binary forms, with or without --- 1,6 ---- # Makefile.dist # ! # Copyright (c) 1996, 1999 The Internet Software Consortium. ! # All rights reserved. # # Redistribution and use in source and binary forms, with or without *************** *** 32,39 **** CATMANPAGES = dhcp-options.cat5 SRC = raw.c parse.c nit.c icmp.c dispatch.c conflex.c upf.c bpf.c socket.c \ ! packet.c memory.c print.c options.c inet.c convert.c \ tree.c tables.c hash.c alloc.c errwarn.c inet_addr.c dlpi.c OBJ = raw.o parse.o nit.o icmp.o dispatch.o conflex.o upf.o bpf.o socket.o \ ! packet.o memory.o print.o options.o inet.o convert.o \ tree.o tables.o hash.o alloc.o errwarn.o inet_addr.o dlpi.o MAN = dhcp-options.5 --- 33,40 ---- CATMANPAGES = dhcp-options.cat5 SRC = raw.c parse.c nit.c icmp.c dispatch.c conflex.c upf.c bpf.c socket.c \ ! lpf.c packet.c memory.c print.c options.c inet.c convert.c \ tree.c tables.c hash.c alloc.c errwarn.c inet_addr.c dlpi.c OBJ = raw.o parse.o nit.o icmp.o dispatch.o conflex.o upf.o bpf.o socket.o \ ! lpf.o packet.o memory.o print.o options.o inet.o convert.o \ tree.o tables.o hash.o alloc.o errwarn.o inet_addr.o dlpi.o MAN = dhcp-options.5 *************** *** 50,60 **** ranlib libdhcp.a ! install: $(CATMANPAGES) ! if [ ! -d $(FFMANDIR) ]; then \ ! mkdir $(FFMANDIR); \ ! chmod 755 $(FFMANDIR); \ ! fi $(MANINSTALL) $(MANFROM) dhcp-options.cat5 $(MANTO) \ ! $(FFMANDIR)/dhcp-options$(FFMANEXT) --- 51,67 ---- ranlib libdhcp.a ! install: all ! for dir in $(FFMANDIR); do \ ! foo=""; \ ! for bar in `echo $(DESTDIR)$${dir} |tr / ' '`; do \ ! foo=$${foo}/$$bar; \ ! if [ ! -d $$foo ]; then \ ! mkdir $$foo; \ ! chmod 755 $$foo; \ ! fi; \ ! done; \ ! done $(MANINSTALL) $(MANFROM) dhcp-options.cat5 $(MANTO) \ ! $(DESTDIR)$(FFMANDIR)/dhcp-options$(FFMANEXT) diff -rNc2 dhcp-2.0b1pl6/common/alloc.c dhcp-2.0b1pl18/common/alloc.c *** dhcp-2.0b1pl6/common/alloc.c Fri May 9 00:56:13 1997 --- dhcp-2.0b1pl18/common/alloc.c Tue Nov 24 14:17:15 1998 *************** *** 4,8 **** /* ! * Copyright (c) 1995, 1996 The Internet Software Consortium. * All rights reserved. * --- 4,8 ---- /* ! * Copyright (c) 1995, 1996, 1998 The Internet Software Consortium. * All rights reserved. * *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: alloc.c,v 1.13 1997/05/09 07:56:13 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: alloc.c,v 1.13.2.1 1998/11/24 22:17:15 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 58,62 **** if (!foo) warn ("No memory for %s.", name); ! memset (foo, 0, size); return foo; } --- 58,63 ---- if (!foo) warn ("No memory for %s.", name); ! else ! memset (foo, 0, size); return foo; } diff -rNc2 dhcp-2.0b1pl6/common/bpf.c dhcp-2.0b1pl18/common/bpf.c *** dhcp-2.0b1pl6/common/bpf.c Mon Oct 20 14:47:13 1997 --- dhcp-2.0b1pl18/common/bpf.c Tue Feb 23 14:09:56 1999 *************** *** 4,9 **** /* ! * Copyright (c) 1995, 1996 The Internet Software Consortium. ! * All rights reserved. * * Redistribution and use in source and binary forms, with or without --- 4,9 ---- /* ! * Copyright (c) 1995, 1996, 1998, 1999 ! * The Internet Software Consortium. All rights reserved. * * Redistribution and use in source and binary forms, with or without *************** *** 43,62 **** #ifndef lint static char copyright[] = ! "$Id: bpf.c,v 1.19 1997/10/20 21:47:13 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" ! #if defined (USE_BPF_SEND) || defined (USE_BPF_RECEIVE) ! #include ! #include - #include - #ifdef NEED_OSF_PFILT_HACKS - #include - #endif #include #include "includes/netinet/ip.h" #include "includes/netinet/udp.h" #include "includes/netinet/if_ether.h" /* Reinitializes the specified interface after an address change. This --- 43,71 ---- #ifndef lint static char copyright[] = ! "$Id: bpf.c,v 1.19.2.8 1999/02/23 22:09:56 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" ! #if defined (USE_BPF_SEND) || defined (USE_BPF_RECEIVE) \ ! || defined (USE_LPF_RECEIVE) ! # if defined (USE_LPF_RECEIVE) ! # include ! # include ! # define bpf_insn sock_filter /* Linux: dare to be gratuitously different. */ ! # else ! # include ! # include ! ! # include ! # if defined (NEED_OSF_PFILT_HACKS) ! # include ! # endif ! # endif #include #include "includes/netinet/ip.h" #include "includes/netinet/udp.h" #include "includes/netinet/if_ether.h" + #endif /* Reinitializes the specified interface after an address change. This *************** *** 81,84 **** --- 90,94 ---- mask. */ + #if defined (USE_BPF_SEND) || defined (USE_BPF_RECEIVE) int if_register_bpf (info) struct interface_info *info; *************** *** 100,103 **** --- 110,118 ---- continue; } else { + if (!b) + error ("No bpf devices.%s%s%s", + " Please read the README", + " section for your operating", + " system."); error ("Can't find free bpf: %m"); } *************** *** 128,147 **** #endif if (!quiet_interface_discovery) ! note ("Sending on BPF/%s/%s/%s", info -> name, print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), (info -> shared_network ? ! info -> shared_network -> name : "unattached")); } #endif /* USE_BPF_SEND */ ! #ifdef USE_BPF_RECEIVE /* Packet filter program... XXX Changes to the filter program may require changes to the constant offsets used in if_register_send to patch the BPF program! XXX */ ! struct bpf_insn filter [] = { /* Make sure this is an IP packet... */ BPF_STMT (BPF_LD + BPF_H + BPF_ABS, 12), --- 143,163 ---- #endif if (!quiet_interface_discovery) ! note ("Sending on BPF/%s/%s%s%s", info -> name, print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), + (info -> shared_network ? "/" : ""), (info -> shared_network ? ! info -> shared_network -> name : "")); } #endif /* USE_BPF_SEND */ ! #if defined (USE_BPF_RECEIVE) || defined (USE_LPF_RECEIVE) /* Packet filter program... XXX Changes to the filter program may require changes to the constant offsets used in if_register_send to patch the BPF program! XXX */ ! struct bpf_insn dhcp_bpf_filter [] = { /* Make sure this is an IP packet... */ BPF_STMT (BPF_LD + BPF_H + BPF_ABS, 12), *************** *** 170,173 **** --- 186,193 ---- }; + int dhcp_bpf_filter_len = sizeof dhcp_bpf_filter / sizeof (struct bpf_insn); + #endif + + #if defined (USE_BPF_RECEIVE) void if_register_receive (info) struct interface_info *info; *************** *** 221,242 **** /* Set up the bpf filter program structure. */ ! p.bf_len = sizeof filter / sizeof (struct bpf_insn); ! p.bf_insns = filter; /* Patch the server port into the BPF program... XXX changes to filter program may require changes to the insn number(s) used below! XXX */ ! filter [8].k = ntohs (local_port); if (ioctl (info -> rfdesc, BIOCSETF, &p) < 0) error ("Can't install packet filter program: %m"); if (!quiet_interface_discovery) ! note ("Listening on BPF/%s/%s/%s", info -> name, print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), (info -> shared_network ? ! info -> shared_network -> name : "unattached")); } #endif /* USE_BPF_RECEIVE */ --- 241,263 ---- /* Set up the bpf filter program structure. */ ! p.bf_len = dhcp_bpf_filter_len; ! p.bf_insns = dhcp_bpf_filter; /* Patch the server port into the BPF program... XXX changes to filter program may require changes to the insn number(s) used below! XXX */ ! dhcp_bpf_filter [8].k = ntohs (local_port); if (ioctl (info -> rfdesc, BIOCSETF, &p) < 0) error ("Can't install packet filter program: %m"); if (!quiet_interface_discovery) ! note ("Listening on BPF/%s/%s%s%s", info -> name, print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), + (info -> shared_network ? "/" : ""), (info -> shared_network ? ! info -> shared_network -> name : "")); } #endif /* USE_BPF_RECEIVE */ *************** *** 255,258 **** --- 276,284 ---- unsigned char buf [256]; struct iovec iov [2]; + int result; + + if (!strcmp (interface -> name, "fallback")) + return send_fallback (interface, packet, raw, + len, from, to, hto); /* Assemble the headers... */ *************** *** 268,272 **** iov [1].iov_len = len; ! return writev(interface -> wfdesc, iov, 2); } #endif /* USE_BPF_SEND */ --- 294,301 ---- iov [1].iov_len = len; ! result = writev(interface -> wfdesc, iov, 2); ! if (result < 0) ! warn ("send_packet: %m"); ! return result; } #endif /* USE_BPF_SEND */ *************** *** 383,386 **** --- 412,431 ---- } while (!length); return 0; + } + + int can_unicast_without_arp () + { + return 1; + } + + void maybe_setup_fallback () + { + struct interface_info *fbi; + fbi = setup_fallback (); + if (fbi) { + if_register_fallback (fbi); + add_protocol ("fallback", fallback_interface -> wfdesc, + fallback_discard, fallback_interface); + } } #endif diff -rNc2 dhcp-2.0b1pl6/common/conflex.c dhcp-2.0b1pl18/common/conflex.c *** dhcp-2.0b1pl6/common/conflex.c Wed Oct 29 10:32:53 1997 --- dhcp-2.0b1pl18/common/conflex.c Mon Feb 8 20:49:04 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: conflex.c,v 1.29 1997/10/29 18:32:53 mellon Exp $ Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: conflex.c,v 1.29.2.3 1999/02/09 04:49:04 mellon Exp $ Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 363,366 **** --- 363,368 ---- if (!strcasecmp (atom + 1, "bandoned")) return ABANDONED; + if (!strcasecmp (atom + 1, "uthoritative")) + return AUTHORITATIVE; break; case 'b': *************** *** 418,421 **** --- 420,425 ---- if (!strcasecmp (atom + 1, "ixed-address")) return FIXED_ADDR; + if (!strcasecmp (atom + 1, "ddi")) + return FDDI; break; case 'g': *************** *** 463,466 **** --- 467,472 ---- if (!strcasecmp (atom + 1, "ext-server")) return NEXT_SERVER; + if (!strcasecmp (atom + 1, "ot")) + return TOKEN_NOT; break; case 'o': *************** *** 527,536 **** break; case 'u': if (!strcasecmp (atom + 1, "id")) return UID; - if (!strcasecmp (atom + 1, "ser-class")) - return USER_CLASS; - if (!strcasecmp (atom + 1, "se-host-decl-names")) - return USE_HOST_DECL_NAMES; if (!strcasecmp (atom + 1, "nknown-clients")) return UNKNOWN_CLIENTS; --- 533,548 ---- break; case 'u': + if (!strncasecmp (atom + 1, "se", 2)) { + if (!strcasecmp (atom + 3, "r-class")) + return USER_CLASS; + if (!strcasecmp (atom + 3, "-host-decl-names")) + return USE_HOST_DECL_NAMES; + if (!strcasecmp (atom + 3, + "-lease-addr-for-default-route")) + return USE_LEASE_ADDR_FOR_DEFAULT_ROUTE; + break; + } if (!strcasecmp (atom + 1, "id")) return UID; if (!strcasecmp (atom + 1, "nknown-clients")) return UNKNOWN_CLIENTS; diff -rNc2 dhcp-2.0b1pl6/common/dhcp-options.5 dhcp-2.0b1pl18/common/dhcp-options.5 *** dhcp-2.0b1pl6/common/dhcp-options.5 Fri Nov 21 15:43:50 1997 --- dhcp-2.0b1pl18/common/dhcp-options.5 Sun Dec 20 10:22:59 1998 *************** *** 1,5 **** .\" dhcp-options.5 .\" ! .\" Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. .\" All rights reserved. .\" --- 1,5 ---- .\" dhcp-options.5 .\" ! .\" Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. .\" All rights reserved. .\" *************** *** 127,131 **** The standard options are: .PP ! \fBoption subnet-mask\fR \fIip-address\fR\fB;\fR .PP The subnet mask option specifies the client's subnet mask as per RFC --- 127,132 ---- The standard options are: .PP ! .B option subnet-mask \fIip-address\fR\fB;\fR ! .RS 0.25i .PP The subnet mask option specifies the client's subnet mask as per RFC *************** *** 137,200 **** assigned will override the subnet mask specified in the subnet declaration. .PP ! \fBoption time-offset\fR \fIint32\fR\fB;\fR .PP The time-offset option specifies the offset of the client's subnet in seconds from Coordinated Universal Time (UTC). .PP ! \fBoption routers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR ... ]\fB;\fR .PP The routers option specifies a list of IP addresses for routers on the client's subnet. Routers should be listed in order of preference. .PP ! \fBoption time-servers\fR \fIip-address [, \fIip-address\fR ... ]\fB;\fR .PP The time-server option specifies a list of RFC 868 time servers available to the client. Servers should be listed in order of preference. .PP ! \fBoption\fR \fBien116-name-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR ... ]; .PP The ien116-name-servers option specifies a list of IEN 116 name servers available to the client. Servers should be listed in order of preference. .PP ! \fBoption\fR \fBdomain-name-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR ... ]\fB;\fR .PP The domain-name-servers option specifies a list of Domain Name System (STD 13, RFC 1035) name servers available to the client. Servers should be listed in order of preference. .PP ! \fBoption\fR \fBlog-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR ... ]\fB;\fR .PP The log-server option specifies a list of MIT-LCS UDP log servers available to the client. Servers should be listed in order of preference. .PP ! \fBoption\fR \fBcookie-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR ... ]\fB;\fR .PP The cookie server option specifies a list of RFC 865 cookie servers available to the client. Servers should be listed in order of preference. .PP ! \fBoption\fR \fBlpr-servers\fR \fIip-address \fR [\fB,\fR \fIip-address\fR ... ]\fB;\fR .PP The LPR server option specifies a list of RFC 1179 line printer servers available to the client. Servers should be listed in order of preference. .PP ! \fBoption\fR \fBimpress-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR ... ]\fB;\fR .PP The impress-server option specifies a list of Imagen Impress servers available to the client. Servers should be listed in order of preference. .PP ! \fBoption\fR \fBresource-location-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR ... ]\fB;\fR .PP This option specifies a list of RFC 887 Resource Location servers available to the client. Servers should be listed in order of preference. .PP ! \fBoption\fR \fBhost-name\fR \fIstring\fR\fB;\fR .PP This option specifies the name of the client. The name may or may --- 138,232 ---- assigned will override the subnet mask specified in the subnet declaration. + .RE .PP ! .B option time-offset \fIint32\fR\fB;\fR ! .RS 0.25i .PP The time-offset option specifies the offset of the client's subnet in seconds from Coordinated Universal Time (UTC). + .RE .PP ! .B option routers \fIip-address\fR [\fB,\fR \fIip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP The routers option specifies a list of IP addresses for routers on the client's subnet. Routers should be listed in order of preference. + .RE .PP ! .B option time-servers \fIip-address\fR [, \fIip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP The time-server option specifies a list of RFC 868 time servers available to the client. Servers should be listed in order of preference. + .RE .PP ! .B option \fBien116-name-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR... ! ]; ! .RS 0.25i .PP The ien116-name-servers option specifies a list of IEN 116 name servers available to the client. Servers should be listed in order of preference. + .RE .PP ! .B option \fBdomain-name-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP The domain-name-servers option specifies a list of Domain Name System (STD 13, RFC 1035) name servers available to the client. Servers should be listed in order of preference. + .RE .PP ! .B option \fBlog-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP The log-server option specifies a list of MIT-LCS UDP log servers available to the client. Servers should be listed in order of preference. + .RE .PP ! .B option \fBcookie-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP The cookie server option specifies a list of RFC 865 cookie servers available to the client. Servers should be listed in order of preference. + .RE .PP ! .B option \fBlpr-servers\fR \fIip-address \fR [\fB,\fR \fIip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP The LPR server option specifies a list of RFC 1179 line printer servers available to the client. Servers should be listed in order of preference. + .RE .PP ! .B option \fBimpress-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP The impress-server option specifies a list of Imagen Impress servers available to the client. Servers should be listed in order of preference. + .RE .PP ! .B option \fBresource-location-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP This option specifies a list of RFC 887 Resource Location servers available to the client. Servers should be listed in order of preference. + .RE .PP ! .B option \fBhost-name\fR \fIstring\fR\fB;\fR ! .RS 0.25i .PP This option specifies the name of the client. The name may or may *************** *** 202,212 **** the domain-name option to specify the domain name). See RFC 1035 for character set restrictions. .PP ! \fBoption\fR \fBboot-size\fR \fIuint16\fR\fB;\fR .PP This option specifies the length in 512-octet blocks of the default boot image for the client. .PP ! \fBoption\fR \fBmerit-dump\fR \fIstring\fR\fB;\fR .PP This option specifies the path-name of a file to which the client's --- 234,248 ---- the domain-name option to specify the domain name). See RFC 1035 for character set restrictions. + .RE .PP ! .B option \fBboot-size\fR \fIuint16\fR\fB;\fR ! .RS 0.25i .PP This option specifies the length in 512-octet blocks of the default boot image for the client. + .RE .PP ! .B option \fBmerit-dump\fR \fIstring\fR\fB;\fR ! .RS 0.25i .PP This option specifies the path-name of a file to which the client's *************** *** 214,240 **** path is formatted as a character string consisting of characters from the NVT ASCII character set. .PP ! \fBoption\fR \fBdomain-name\fR \fIstring\fR\fB;\fR .PP This option specifies the domain name that client should use when resolving hostnames via the Domain Name System. .PP ! \fBoption\fR \fBswap-server\fR \fIip-address\fR\fB;\fR .PP This specifies the IP address of the client's swap server. .PP ! \fBoption\fR \fBroot-path\fR \fIstring\fB;\fR\fR .PP This option specifies the path-name that contains the client's root disk. The path is formatted as a character string consisting of characters from the NVT ASCII character set. .PP ! \fBoption\fR \fBip-forwarding\fR \fIflag\fR\fB;\fR .PP This option specifies whether the client should configure its IP layer for packet forwarding. A value of 0 means disable IP forwarding, and a value of 1 means enable IP forwarding. .PP ! \fBoption\fR \fBnon-local-source-routing\fR \fIflag\fR\fB;\fR .PP This option specifies whether the client should configure its IP --- 250,286 ---- path is formatted as a character string consisting of characters from the NVT ASCII character set. + .RE .PP ! .B option \fBdomain-name\fR \fIstring\fR\fB;\fR ! .RS 0.25i .PP This option specifies the domain name that client should use when resolving hostnames via the Domain Name System. + .RE .PP ! .B option \fBswap-server\fR \fIip-address\fR\fB;\fR ! .RS 0.25i .PP This specifies the IP address of the client's swap server. + .RE .PP ! .B option \fBroot-path\fR \fIstring\fB;\fR\fR ! .RS 0.25i .PP This option specifies the path-name that contains the client's root disk. The path is formatted as a character string consisting of characters from the NVT ASCII character set. + .RE .PP ! .B option \fBip-forwarding\fR \fIflag\fR\fB;\fR ! .RS 0.25i .PP This option specifies whether the client should configure its IP layer for packet forwarding. A value of 0 means disable IP forwarding, and a value of 1 means enable IP forwarding. + .RE .PP ! .B option \fBnon-local-source-routing\fR \fIflag\fR\fB;\fR ! .RS 0.25i .PP This option specifies whether the client should configure its IP *************** *** 243,248 **** of 0 means disallow forwarding of such datagrams, and a value of 1 means allow forwarding. .PP ! \fBoption\fR \fBpolicy-filter\fR \fIip-address ip-address\fR [\fB,\fR \fIip-address ip-address\fR ... ]\fB;\fR .PP This option specifies policy filters for non-local source routing. --- 289,297 ---- of 0 means disallow forwarding of such datagrams, and a value of 1 means allow forwarding. + .RE .PP ! .B option \fBpolicy-filter\fR \fIip-address ip-address\fR [\fB,\fR \fIip-address ip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP This option specifies policy filters for non-local source routing. *************** *** 254,275 **** .PP See STD 3 (RFC1122) for further information. .PP ! \fBoption\fR \fBmax-dgram-reassembly\fR \fIuint16\fR\fB;\fR .PP This option specifies the maximum size datagram that the client should be prepared to reassemble. The minimum value legal value is 576. .PP ! \fBoption\fR \fBdefault-ip-ttl\fR \fIuint8;\fR .PP This option specifies the default time-to-live that the client should use on outgoing datagrams. .PP ! \fBoption\fR \fBpath-mtu-aging-timeout\fR \fIuint32\fR\fB;\fR .PP This option specifies the timeout (in seconds) to use when aging Path MTU values discovered by the mechanism defined in RFC 1191. .PP ! \fBoption\fR \fBpath-mtu-plateau-table\fR \fIuint16\fR [\fB,\fR \fIuint16\fR ... ]\fB;\fR .PP This option specifies a table of MTU sizes to use when performing --- 303,333 ---- .PP See STD 3 (RFC1122) for further information. + .RE .PP ! .B option \fBmax-dgram-reassembly\fR \fIuint16\fR\fB;\fR ! .RS 0.25i .PP This option specifies the maximum size datagram that the client should be prepared to reassemble. The minimum value legal value is 576. + .RE .PP ! .B option \fBdefault-ip-ttl\fR \fIuint8;\fR ! .RS 0.25i .PP This option specifies the default time-to-live that the client should use on outgoing datagrams. + .RE .PP ! .B option \fBpath-mtu-aging-timeout\fR \fIuint32\fR\fB;\fR ! .RS 0.25i .PP This option specifies the timeout (in seconds) to use when aging Path MTU values discovered by the mechanism defined in RFC 1191. + .RE .PP ! .B option \fBpath-mtu-plateau-table\fR \fIuint16\fR [\fB,\fR \fIuint16\fR... ! ]\fB;\fR ! .RS 0.25i .PP This option specifies a table of MTU sizes to use when performing *************** *** 277,287 **** a list of 16-bit unsigned integers, ordered from smallest to largest. The minimum MTU value cannot be smaller than 68. .PP ! \fBoption\fR \fBinterface-mtu\fR \fIuint16\fR\fB;\fR .PP This option specifies the MTU to use on this interface. The minimum legal value for the MTU is 68. .PP ! \fBoption\fR \fBall-subnets-local\fR \fIflag\fR\fB;\fR .PP This option specifies whether or not the client may assume that all --- 335,349 ---- a list of 16-bit unsigned integers, ordered from smallest to largest. The minimum MTU value cannot be smaller than 68. + .RE .PP ! .B option \fBinterface-mtu\fR \fIuint16\fR\fB;\fR ! .RS 0.25i .PP This option specifies the MTU to use on this interface. The minimum legal value for the MTU is 68. + .RE .PP ! .B option \fBall-subnets-local\fR \fIflag\fR\fB;\fR ! .RS 0.25i .PP This option specifies whether or not the client may assume that all *************** *** 291,302 **** the same MTU. A value of 0 means that the client should assume that some subnets of the directly connected network may have smaller MTUs. .PP ! \fBoption\fR \fBbroadcast-address\fR \fIip-address\fR\fB;\fR .PP This option specifies the broadcast address in use on the client's subnet. Legal values for broadcast addresses are specified in section 3.2.1.3 of STD 3 (RFC1122). .PP ! \fBoption\fR \fBperform-mask-discovery\fR \fIflag\fR\fB;\fR .PP This option specifies whether or not the client should perform subnet --- 353,368 ---- the same MTU. A value of 0 means that the client should assume that some subnets of the directly connected network may have smaller MTUs. + .RE .PP ! .B option \fBbroadcast-address\fR \fIip-address\fR\fB;\fR ! .RS 0.25i .PP This option specifies the broadcast address in use on the client's subnet. Legal values for broadcast addresses are specified in section 3.2.1.3 of STD 3 (RFC1122). + .RE .PP ! .B option \fBperform-mask-discovery\fR \fIflag\fR\fB;\fR ! .RS 0.25i .PP This option specifies whether or not the client should perform subnet *************** *** 304,309 **** should not perform mask discovery. A value of 1 means that the client should perform mask discovery. .PP ! \fBoption\fR \fBmask-supplier\fR \fIflag\fR\fB;\fR .PP This option specifies whether or not the client should respond to --- 370,377 ---- should not perform mask discovery. A value of 1 means that the client should perform mask discovery. + .RE .PP ! .B option \fBmask-supplier\fR \fIflag\fR\fB;\fR ! .RS 0.25i .PP This option specifies whether or not the client should respond to *************** *** 311,316 **** client should not respond. A value of 1 means that the client should respond. .PP ! \fBoption\fR \fBrouter-discovery\fR \fIflag\fR\fB;\fR .PP This option specifies whether or not the client should solicit --- 379,386 ---- client should not respond. A value of 1 means that the client should respond. + .RE .PP ! .B option \fBrouter-discovery\fR \fIflag\fR\fB;\fR ! .RS 0.25i .PP This option specifies whether or not the client should solicit *************** *** 319,329 **** router discovery. A value of 1 means that the client should perform router discovery. .PP ! \fBoption\fR \fBrouter-solicitation-address\fR \fIip-address\fR\fB;\fR .PP This option specifies the address to which the client should transmit router solicitation requests. .PP ! \fBoption\fR \fBstatic-routes\fR \fIip-address ip-address\fR [\fB,\fR \fIip-address ip-address\fR ... ]\fB;\fR .PP This option specifies a list of static routes that the client should --- 389,404 ---- router discovery. A value of 1 means that the client should perform router discovery. + .RE .PP ! .B option \fBrouter-solicitation-address\fR \fIip-address\fR\fB;\fR ! .RS 0.25i .PP This option specifies the address to which the client should transmit router solicitation requests. + .RE .PP ! .B option \fBstatic-routes\fR \fIip-address ip-address\fR [\fB,\fR \fIip-address ip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP This option specifies a list of static routes that the client should *************** *** 340,345 **** .B routers option. .PP ! \fBoption\fR \fBtrailer-encapsulation\fR \fIflag\fR\fB;\fR .PP This option specifies whether or not the client should negotiate the --- 415,422 ---- .B routers option. + .RE .PP ! .B option \fBtrailer-encapsulation\fR \fIflag\fR\fB;\fR ! .RS 0.25i .PP This option specifies whether or not the client should negotiate the *************** *** 347,356 **** of 0 indicates that the client should not attempt to use trailers. A value of 1 means that the client should attempt to use trailers. .PP ! \fBoption\fR \fBarp-cache-timeout\fR \fIuint32\fR\fB;\fR .PP This option specifies the timeout in seconds for ARP cache entries. .PP ! \fBoption\fR \fBieee802-3-encapsulation\fR \fIflag\fR\fB;\fR .PP This option specifies whether or not the client should use Ethernet --- 424,437 ---- of 0 indicates that the client should not attempt to use trailers. A value of 1 means that the client should attempt to use trailers. + .RE .PP ! .B option \fBarp-cache-timeout\fR \fIuint32\fR\fB;\fR ! .RS 0.25i .PP This option specifies the timeout in seconds for ARP cache entries. + .RE .PP ! .B option \fBieee802-3-encapsulation\fR \fIflag\fR\fB;\fR ! .RS 0.25i .PP This option specifies whether or not the client should use Ethernet *************** *** 359,369 **** should use RFC 894 encapsulation. A value of 1 means that the client should use RFC 1042 encapsulation. .PP ! \fBoption\fR \fBdefault-tcp-ttl\fR \fIuint8\fR\fB;\fR .PP This option specifies the default TTL that the client should use when sending TCP segments. The minimum value is 1. .PP ! \fBoption\fR \fBtcp-keepalive-interval\fR \fIuint32\fR\fB;\fR .PP This option specifies the interval (in seconds) that the client TCP --- 440,454 ---- should use RFC 894 encapsulation. A value of 1 means that the client should use RFC 1042 encapsulation. + .RE .PP ! .B option \fBdefault-tcp-ttl\fR \fIuint8\fR\fB;\fR ! .RS 0.25i .PP This option specifies the default TTL that the client should use when sending TCP segments. The minimum value is 1. + .RE .PP ! .B option \fBtcp-keepalive-interval\fR \fIuint32\fR\fB;\fR ! .RS 0.25i .PP This option specifies the interval (in seconds) that the client TCP *************** *** 372,377 **** indicates that the client should not generate keepalive messages on connections unless specifically requested by an application. .PP ! \fBoption\fR \fBtcp-keepalive-garbage\fR \fIflag\fR\fB;\fR .PP This option specifies the whether or not the client should send TCP --- 457,464 ---- indicates that the client should not generate keepalive messages on connections unless specifically requested by an application. + .RE .PP ! .B option \fBtcp-keepalive-garbage\fR \fIflag\fR\fB;\fR ! .RS 0.25i .PP This option specifies the whether or not the client should send TCP *************** *** 380,443 **** should not be sent. A value of 1 indicates that a garbage octet should be sent. .PP ! \fBoption\fR \fBnis-domain\fR \fIstring\fR\fB;\fR .PP This option specifies the name of the client's NIS (Sun Network Information Services) domain. The domain is formatted as a character string consisting of characters from the NVT ASCII character set. .PP ! \fBoption\fR \fBnis-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR ... ]\fB;\fR .PP This option specifies a list of IP addresses indicating NIS servers available to the client. Servers should be listed in order of preference. .PP ! \fBoption\fR \fBntp-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR ... ]\fB;\fR .PP This option specifies a list of IP addresses indicating NTP (RFC 1035) servers available to the client. Servers should be listed in order of preference. .PP ! \fBoption\fR \fBnetbios-name-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR ... ]\fB;\fR .PP The NetBIOS name server (NBNS) option specifies a list of RFC ! 1001/1002 NBNS name servers listed in order of preference. ! .PP ! \fBoption\fR \fBnetbios-dd-server\fR \fIip-address\fR [\fB,\fR \fIip-address\fR ... ]\fB;\fR .PP The NetBIOS datagram distribution server (NBDD) option specifies a list of RFC 1001/1002 NBDD servers listed in order of preference. .PP ! \fBoption\fR \fBnetbios-node-type\fR \fIuint8\fR\fB;\fR .PP The NetBIOS node type option allows NetBIOS over TCP/IP clients which are configurable to be configured as described in RFC 1001/1002. The value is specified as a single octet which identifies the client type. - A value of 1 corresponds to a NetBIOS B-node; a value of 2 corresponds - to a P-node; a value of 4 corresponds to an M-node; a value of 8 - corresponds to an H-node. .PP ! \fBoption\fR \fBnetbios-scope\fR \fIstring\fR\fB;\fR .PP The NetBIOS scope option specifies the NetBIOS over TCP/IP scope parameter for the client as specified in RFC 1001/1002. See RFC1001, RFC1002, and RFC1035 for character-set restrictions. .PP ! \fBoption\fR \fBfont-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR ... ]\fB;\fR .PP This option specifies a list of X Window System Font servers available to the client. Servers should be listed in order of preference. .PP ! \fBoption\fR \fBx-display-manager\fR \fIip-address\fR [\fB,\fR \fIip-address\fR ... ]\fB;\fR .PP This option specifies a list of systems that are running the X Window System Display Manager and are available to the client. Addresses should be listed in order of preference. .PP ! \fBoption\fR \fBdhcp-client-identifier\fR \fIdata-string\fR\fB;\fR .PP This option can be used to specify the a DHCP client identifier in a host declaration, so that dhcpd can find the host record by matching against the client identifier. .SH SEE ALSO dhcpd.conf(5), dhcpd.leases(5), dhclient.conf(5), dhcpd(8), --- 467,573 ---- should not be sent. A value of 1 indicates that a garbage octet should be sent. + .RE .PP ! .B option \fBnis-domain\fR \fIstring\fR\fB;\fR ! .RS 0.25i .PP This option specifies the name of the client's NIS (Sun Network Information Services) domain. The domain is formatted as a character string consisting of characters from the NVT ASCII character set. + .RE .PP ! .B option \fBnis-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP This option specifies a list of IP addresses indicating NIS servers available to the client. Servers should be listed in order of preference. + .RE .PP ! .B option \fBntp-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP This option specifies a list of IP addresses indicating NTP (RFC 1035) servers available to the client. Servers should be listed in order of preference. + .RE .PP ! .B option \fBnetbios-name-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP The NetBIOS name server (NBNS) option specifies a list of RFC ! 1001/1002 NBNS name servers listed in order of preference. NetBIOS ! Name Service is currently more commonly referred to as WINS. WINS ! servers can be specified using the netbios-name-servers option. ! .RE ! .PP ! .B option \fBnetbios-dd-server\fR \fIip-address\fR [\fB,\fR \fIip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP The NetBIOS datagram distribution server (NBDD) option specifies a list of RFC 1001/1002 NBDD servers listed in order of preference. + .RE .PP ! .B option \fBnetbios-node-type\fR \fIuint8\fR\fB;\fR ! .RS 0.25i .PP The NetBIOS node type option allows NetBIOS over TCP/IP clients which are configurable to be configured as described in RFC 1001/1002. The value is specified as a single octet which identifies the client type. .PP ! Possible node types are: ! .PP ! .TP 5 ! .I 1 ! B-node: Broadcast - no WINS ! .TP ! .I 2 ! P-node: Peer - WINS only. ! .TP ! .I 4 ! M-node: Mixed - broadcast, then WINS ! .TP ! .I 8 ! H-node: Hybrid - WINS, then broadcast ! .RE ! .PP ! .B option ! .B netbios-scope ! .I string\fB;\fR ! .RS 0.25i .PP The NetBIOS scope option specifies the NetBIOS over TCP/IP scope parameter for the client as specified in RFC 1001/1002. See RFC1001, RFC1002, and RFC1035 for character-set restrictions. + .RE .PP ! .B option \fBfont-servers\fR \fIip-address\fR [\fB,\fR \fIip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP This option specifies a list of X Window System Font servers available to the client. Servers should be listed in order of preference. + .RE .PP ! .B option \fBx-display-manager\fR \fIip-address\fR [\fB,\fR \fIip-address\fR... ! ]\fB;\fR ! .RS 0.25i .PP This option specifies a list of systems that are running the X Window System Display Manager and are available to the client. Addresses should be listed in order of preference. + .RE .PP ! .B option \fBdhcp-client-identifier\fR \fIdata-string\fR\fB;\fR ! .RS 0.25i .PP This option can be used to specify the a DHCP client identifier in a host declaration, so that dhcpd can find the host record by matching against the client identifier. + .RE .SH SEE ALSO dhcpd.conf(5), dhcpd.leases(5), dhclient.conf(5), dhcpd(8), diff -rNc2 dhcp-2.0b1pl6/common/dhcp-options.cat5 dhcp-2.0b1pl18/common/dhcp-options.cat5 *** dhcp-2.0b1pl6/common/dhcp-options.cat5 Fri Nov 21 23:06:23 1997 --- dhcp-2.0b1pl18/common/dhcp-options.cat5 Fri Feb 5 12:55:39 1999 *************** *** 89,128 **** The standard options are: ! ooppttiioonn ssuubbnneett--mmaasskk _i_p_-_a_d_d_r_e_s_s;; ! The subnet mask option specifies the client's subnet mask ! as per RFC 950. If no subnet mask option is provided any­ ! where in scope, as a last resort dhcpd will use the subnet ! mask from the subnet declaration for the network on which ! an address is being assigned. However, _a_n_y subnet-mask ! option declaration that is in scope for the address being ! assigned will override the subnet mask specified in the ! subnet declaration. ! ooppttiioonn ttiimmee--ooffffsseett _i_n_t_3_2;; ! The time-offset option specifies the offset of the ! client's subnet in seconds from Coordinated Universal Time ! (UTC). ! ooppttiioonn rroouutteerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ... ];; ! The routers option specifies a list of IP addresses for ! routers on the client's subnet. Routers should be listed ! in order of preference. ! ooppttiioonn ttiimmee--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s _[_, _i_p_-_a_d_d_r_e_s_s ... ];; ! The time-server option specifies a list of RFC 868 time ! servers available to the client. Servers should be listed ! in order of preference. ! ooppttiioonn iieenn111166--nnaammee--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ... ! ]; ! The ien116-name-servers option specifies a list of IEN 116 ! name servers available to the client. Servers should be ! listed in order of preference. --- 89,128 ---- The standard options are: ! ooppttiioonn ssuubbnneett--mmaasskk _i_p_-_a_d_d_r_e_s_s;; ! The subnet mask option specifies the client's subnet ! mask as per RFC 950. If no subnet mask option is pro­ ! vided anywhere in scope, as a last resort dhcpd will ! use the subnet mask from the subnet declaration for the ! network on which an address is being assigned. How­ ! ever, _a_n_y subnet-mask option declaration that is in ! scope for the address being assigned will override the ! subnet mask specified in the subnet declaration. ! ooppttiioonn ttiimmee--ooffffsseett _i_n_t_3_2;; ! The time-offset option specifies the offset of the ! client's subnet in seconds from Coordinated Universal ! Time (UTC). ! ooppttiioonn rroouutteerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; ! The routers option specifies a list of IP addresses for ! routers on the client's subnet. Routers should be ! listed in order of preference. ! ooppttiioonn ttiimmee--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [, _i_p_-_a_d_d_r_e_s_s... ];; ! The time-server option specifies a list of RFC 868 time ! servers available to the client. Servers should be ! listed in order of preference. ! ooppttiioonn iieenn111166--nnaammee--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ]; ! The ien116-name-servers option specifies a list of IEN ! 116 name servers available to the client. Servers ! should be listed in order of preference. + ooppttiioonn ddoommaaiinn--nnaammee--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; *************** *** 137,194 **** ! ooppttiioonn ddoommaaiinn--nnaammee--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ... ! ];; ! ! The domain-name-servers option specifies a list of Domain ! Name System (STD 13, RFC 1035) name servers available to ! the client. Servers should be listed in order of prefer­ ! ence. ! ooppttiioonn lloogg--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ... ];; ! The log-server option specifies a list of MIT-LCS UDP log ! servers available to the client. Servers should be listed ! in order of preference. ! ooppttiioonn ccooookkiiee--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ... ];; ! The cookie server option specifies a list of RFC 865 ! cookie servers available to the client. Servers should be ! listed in order of preference. ! ooppttiioonn llpprr--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ... ];; ! The LPR server option specifies a list of RFC 1179 line ! printer servers available to the client. Servers should ! be listed in order of preference. ! ooppttiioonn iimmpprreessss--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ... ];; ! The impress-server option specifies a list of Imagen ! Impress servers available to the client. Servers should ! be listed in order of preference. ! ooppttiioonn rreessoouurrccee--llooccaattiioonn--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ! ... ];; ! This option specifies a list of RFC 887 Resource Location ! servers available to the client. Servers should be listed ! in order of preference. ! ooppttiioonn hhoosstt--nnaammee _s_t_r_i_n_g;; ! This option specifies the name of the client. The name ! may or may not be qualified with the local domain name (it ! is preferable to use the domain-name option to specify the ! domain name). See RFC 1035 for character set restric­ ! tions. ! ooppttiioonn bboooott--ssiizzee _u_i_n_t_1_6;; ! This option specifies the length in 512-octet blocks of ! the default boot image for the client. ! ooppttiioonn mmeerriitt--dduummpp _s_t_r_i_n_g;; --- 137,194 ---- ! The domain-name-servers option specifies a list of ! Domain Name System (STD 13, RFC 1035) name servers ! available to the client. Servers should be listed in ! order of preference. ! ooppttiioonn lloogg--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; ! The log-server option specifies a list of MIT-LCS UDP ! log servers available to the client. Servers should be ! listed in order of preference. ! ooppttiioonn ccooookkiiee--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; ! The cookie server option specifies a list of RFC 865 ! cookie servers available to the client. Servers should ! be listed in order of preference. ! ooppttiioonn llpprr--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; ! The LPR server option specifies a list of RFC 1179 line ! printer servers available to the client. Servers ! should be listed in order of preference. ! ooppttiioonn iimmpprreessss--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; ! The impress-server option specifies a list of Imagen ! Impress servers available to the client. Servers ! should be listed in order of preference. ! ooppttiioonn rreessoouurrccee--llooccaattiioonn--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_- ! _a_d_d_r_e_s_s... ];; ! This option specifies a list of RFC 887 Resource Loca­ ! tion servers available to the client. Servers should ! be listed in order of preference. ! ooppttiioonn hhoosstt--nnaammee _s_t_r_i_n_g;; ! This option specifies the name of the client. The name ! may or may not be qualified with the local domain name ! (it is preferable to use the domain-name option to ! specify the domain name). See RFC 1035 for character ! set restrictions. ! ooppttiioonn bboooott--ssiizzee _u_i_n_t_1_6;; ! This option specifies the length in 512-octet blocks of ! the default boot image for the client. ! ooppttiioonn mmeerriitt--dduummpp _s_t_r_i_n_g;; + This option specifies the path-name of a file to which + the client's core image should be dumped in the event + the client crashes. The path is formatted as a *************** *** 203,260 **** ! This option specifies the path-name of a file to which the ! client's core image should be dumped in the event the ! client crashes. The path is formatted as a character ! string consisting of characters from the NVT ASCII charac­ ! ter set. ! ooppttiioonn ddoommaaiinn--nnaammee _s_t_r_i_n_g;; ! This option specifies the domain name that client should ! use when resolving hostnames via the Domain Name System. ! ooppttiioonn sswwaapp--sseerrvveerr _i_p_-_a_d_d_r_e_s_s;; ! This specifies the IP address of the client's swap server. ! ooppttiioonn rroooott--ppaatthh _s_t_r_i_n_g;; ! This option specifies the path-name that contains the ! client's root disk. The path is formatted as a character ! string consisting of characters from the NVT ASCII charac­ ! ter set. ! ooppttiioonn iipp--ffoorrwwaarrddiinngg _f_l_a_g;; ! This option specifies whether the client should configure ! its IP layer for packet forwarding. A value of 0 means ! disable IP forwarding, and a value of 1 means enable IP ! forwarding. ! ooppttiioonn nnoonn--llooccaall--ssoouurrccee--rroouuttiinngg _f_l_a_g;; ! This option specifies whether the client should configure ! its IP layer to allow forwarding of datagrams with non- ! local source routes (see Section 3.3.5 of [4] for a dis­ ! cussion of this topic). A value of 0 means disallow for­ ! warding of such datagrams, and a value of 1 means allow ! forwarding. ! ooppttiioonn ppoolliiccyy--ffiilltteerr _i_p_-_a_d_d_r_e_s_s _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ! _i_p_-_a_d_d_r_e_s_s ... ];; ! This option specifies policy filters for non-local source ! routing. The filters consist of a list of IP addresses ! and masks which specify destination/mask pairs with which ! to filter incoming source routes. ! Any source routed datagram whose next-hop address does not ! match one of the filters should be discarded by the ! client. ! See STD 3 (RFC1122) for further information. ! ooppttiioonn mmaaxx--ddggrraamm--rreeaasssseemmbbllyy _u_i_n_t_1_6;; --- 203,260 ---- ! character string consisting of characters from the NVT ! ASCII character set. ! ooppttiioonn ddoommaaiinn--nnaammee _s_t_r_i_n_g;; ! This option specifies the domain name that client ! should use when resolving hostnames via the Domain Name ! System. ! ooppttiioonn sswwaapp--sseerrvveerr _i_p_-_a_d_d_r_e_s_s;; ! This specifies the IP address of the client's swap ! server. ! ooppttiioonn rroooott--ppaatthh _s_t_r_i_n_g;; ! This option specifies the path-name that contains the ! client's root disk. The path is formatted as a charac­ ! ter string consisting of characters from the NVT ASCII ! character set. ! ooppttiioonn iipp--ffoorrwwaarrddiinngg _f_l_a_g;; ! This option specifies whether the client should config­ ! ure its IP layer for packet forwarding. A value of 0 ! means disable IP forwarding, and a value of 1 means ! enable IP forwarding. ! ooppttiioonn nnoonn--llooccaall--ssoouurrccee--rroouuttiinngg _f_l_a_g;; ! This option specifies whether the client should config­ ! ure its IP layer to allow forwarding of datagrams with ! non-local source routes (see Section 3.3.5 of [4] for a ! discussion of this topic). A value of 0 means disallow ! forwarding of such datagrams, and a value of 1 means ! allow forwarding. ! ooppttiioonn ppoolliiccyy--ffiilltteerr _i_p_-_a_d_d_r_e_s_s _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ! _i_p_-_a_d_d_r_e_s_s... ];; ! This option specifies policy filters for non-local ! source routing. The filters consist of a list of IP ! addresses and masks which specify destination/mask ! pairs with which to filter incoming source routes. ! Any source routed datagram whose next-hop address does ! not match one of the filters should be discarded by the ! client. ! See STD 3 (RFC1122) for further information. ! ooppttiioonn mmaaxx--ddggrraamm--rreeaasssseemmbbllyy _u_i_n_t_1_6;; + This option specifies the maximum size datagram that *************** *** 269,326 **** ! This option specifies the maximum size datagram that the ! client should be prepared to reassemble. The minimum ! value legal value is 576. ! ! ooppttiioonn ddeeffaauulltt--iipp--ttttll _u_i_n_t_8_; ! This option specifies the default time-to-live that the ! client should use on outgoing datagrams. ! ooppttiioonn ppaatthh--mmttuu--aaggiinngg--ttiimmeeoouutt _u_i_n_t_3_2;; ! This option specifies the timeout (in seconds) to use when ! aging Path MTU values discovered by the mechanism defined ! in RFC 1191. ! ooppttiioonn ppaatthh--mmttuu--ppllaatteeaauu--ttaabbllee _u_i_n_t_1_6 [,, _u_i_n_t_1_6 ... ];; ! This option specifies a table of MTU sizes to use when ! performing Path MTU Discovery as defined in RFC 1191. The ! table is formatted as a list of 16-bit unsigned integers, ! ordered from smallest to largest. The minimum MTU value ! cannot be smaller than 68. ! ooppttiioonn iinntteerrffaaccee--mmttuu _u_i_n_t_1_6;; ! This option specifies the MTU to use on this interface. ! The minimum legal value for the MTU is 68. ! ooppttiioonn aallll--ssuubbnneettss--llooccaall _f_l_a_g;; ! This option specifies whether or not the client may assume ! that all subnets of the IP network to which the client is ! connected use the same MTU as the subnet of that network ! to which the client is directly connected. A value of 1 ! indicates that all subnets share the same MTU. A value of ! 0 means that the client should assume that some subnets of ! the directly connected network may have smaller MTUs. ! ooppttiioonn bbrrooaaddccaasstt--aaddddrreessss _i_p_-_a_d_d_r_e_s_s;; ! This option specifies the broadcast address in use on the ! client's subnet. Legal values for broadcast addresses are ! specified in section 3.2.1.3 of STD 3 (RFC1122). ! ooppttiioonn ppeerrffoorrmm--mmaasskk--ddiissccoovveerryy _f_l_a_g;; ! This option specifies whether or not the client should ! perform subnet mask discovery using ICMP. A value of 0 ! indicates that the client should not perform mask discov­ ! ery. A value of 1 means that the client should perform ! mask discovery. ! ooppttiioonn mmaasskk--ssuupppplliieerr _f_l_a_g;; --- 269,326 ---- ! the client should be prepared to reassemble. The mini­ ! mum value legal value is 576. ! ooppttiioonn ddeeffaauulltt--iipp--ttttll _u_i_n_t_8_; ! This option specifies the default time-to-live that the ! client should use on outgoing datagrams. ! ooppttiioonn ppaatthh--mmttuu--aaggiinngg--ttiimmeeoouutt _u_i_n_t_3_2;; ! This option specifies the timeout (in seconds) to use ! when aging Path MTU values discovered by the mechanism ! defined in RFC 1191. ! ooppttiioonn ppaatthh--mmttuu--ppllaatteeaauu--ttaabbllee _u_i_n_t_1_6 [,, _u_i_n_t_1_6... ];; ! This option specifies a table of MTU sizes to use when ! performing Path MTU Discovery as defined in RFC 1191. ! The table is formatted as a list of 16-bit unsigned ! integers, ordered from smallest to largest. The mini­ ! mum MTU value cannot be smaller than 68. ! ooppttiioonn iinntteerrffaaccee--mmttuu _u_i_n_t_1_6;; ! This option specifies the MTU to use on this interface. ! The minimum legal value for the MTU is 68. ! ooppttiioonn aallll--ssuubbnneettss--llooccaall _f_l_a_g;; ! This option specifies whether or not the client may ! assume that all subnets of the IP network to which the ! client is connected use the same MTU as the subnet of ! that network to which the client is directly connected. ! A value of 1 indicates that all subnets share the same ! MTU. A value of 0 means that the client should assume ! that some subnets of the directly connected network may ! have smaller MTUs. ! ooppttiioonn bbrrooaaddccaasstt--aaddddrreessss _i_p_-_a_d_d_r_e_s_s;; ! This option specifies the broadcast address in use on ! the client's subnet. Legal values for broadcast ! addresses are specified in section 3.2.1.3 of STD 3 ! (RFC1122). ! ooppttiioonn ppeerrffoorrmm--mmaasskk--ddiissccoovveerryy _f_l_a_g;; ! This option specifies whether or not the client should ! perform subnet mask discovery using ICMP. A value of 0 ! indicates that the client should not perform mask dis­ ! covery. A value of 1 means that the client should per­ ! form mask discovery. + ooppttiioonn mmaasskk--ssuupppplliieerr _f_l_a_g;; *************** *** 335,392 **** ! This option specifies whether or not the client should ! respond to subnet mask requests using ICMP. A value of 0 ! indicates that the client should not respond. A value of ! 1 means that the client should respond. ! ooppttiioonn rroouutteerr--ddiissccoovveerryy _f_l_a_g;; ! This option specifies whether or not the client should ! solicit routers using the Router Discovery mechanism ! defined in RFC 1256. A value of 0 indicates that the ! client should not perform router discovery. A value of 1 ! means that the client should perform router discovery. ! ooppttiioonn rroouutteerr--ssoolliicciittaattiioonn--aaddddrreessss _i_p_-_a_d_d_r_e_s_s;; ! This option specifies the address to which the client ! should transmit router solicitation requests. ! ooppttiioonn ssttaattiicc--rroouutteess _i_p_-_a_d_d_r_e_s_s _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ! _i_p_-_a_d_d_r_e_s_s ... ];; ! This option specifies a list of static routes that the ! client should install in its routing cache. If multiple ! routes to the same destination are specified, they are ! listed in descending order of priority. ! The routes consist of a list of IP address pairs. The ! first address is the destination address, and the second ! address is the router for the destination. ! The default route (0.0.0.0) is an illegal destination for ! a static route. To specify the default route, use the ! rroouutteerrss option. ! ooppttiioonn ttrraaiilleerr--eennccaappssuullaattiioonn _f_l_a_g;; ! This option specifies whether or not the client should ! negotiate the use of trailers (RFC 893 [14]) when using ! the ARP protocol. A value of 0 indicates that the client ! should not attempt to use trailers. A value of 1 means ! that the client should attempt to use trailers. ! ooppttiioonn aarrpp--ccaacchhee--ttiimmeeoouutt _u_i_n_t_3_2;; ! This option specifies the timeout in seconds for ARP cache ! entries. ! ooppttiioonn iieeeeee880022--33--eennccaappssuullaattiioonn _f_l_a_g;; ! This option specifies whether or not the client should use ! Ethernet Version 2 (RFC 894) or IEEE 802.3 (RFC 1042) ! encapsulation if the interface is an Ethernet. A value of ! 0 indicates that the client should use RFC 894 encapsula­ ! tion. A value of 1 means that the client should use RFC --- 335,392 ---- ! This option specifies whether or not the client should ! respond to subnet mask requests using ICMP. A value of ! 0 indicates that the client should not respond. A ! value of 1 means that the client should respond. ! ooppttiioonn rroouutteerr--ddiissccoovveerryy _f_l_a_g;; ! This option specifies whether or not the client should ! solicit routers using the Router Discovery mechanism ! defined in RFC 1256. A value of 0 indicates that the ! client should not perform router discovery. A value of ! 1 means that the client should perform router discov­ ! ery. ! ooppttiioonn rroouutteerr--ssoolliicciittaattiioonn--aaddddrreessss _i_p_-_a_d_d_r_e_s_s;; ! This option specifies the address to which the client ! should transmit router solicitation requests. ! ooppttiioonn ssttaattiicc--rroouutteess _i_p_-_a_d_d_r_e_s_s _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ! _i_p_-_a_d_d_r_e_s_s... ];; ! This option specifies a list of static routes that the ! client should install in its routing cache. If multi­ ! ple routes to the same destination are specified, they ! are listed in descending order of priority. ! The routes consist of a list of IP address pairs. The ! first address is the destination address, and the sec­ ! ond address is the router for the destination. ! The default route (0.0.0.0) is an illegal destination ! for a static route. To specify the default route, use ! the rroouutteerrss option. ! ooppttiioonn ttrraaiilleerr--eennccaappssuullaattiioonn _f_l_a_g;; ! This option specifies whether or not the client should ! negotiate the use of trailers (RFC 893 [14]) when using ! the ARP protocol. A value of 0 indicates that the ! client should not attempt to use trailers. A value of ! 1 means that the client should attempt to use trailers. ! ooppttiioonn aarrpp--ccaacchhee--ttiimmeeoouutt _u_i_n_t_3_2;; ! This option specifies the timeout in seconds for ARP ! cache entries. ! ooppttiioonn iieeeeee880022--33--eennccaappssuullaattiioonn _f_l_a_g;; ! This option specifies whether or not the client should ! use Ethernet Version 2 (RFC 894) or IEEE 802.3 (RFC ! 1042) encapsulation if the interface is an Ethernet. A ! value of 0 indicates that the client should use RFC 894 *************** *** 401,458 **** ! 1042 encapsulation. ! ooppttiioonn ddeeffaauulltt--ttccpp--ttttll _u_i_n_t_8;; ! This option specifies the default TTL that the client ! should use when sending TCP segments. The minimum value ! is 1. ! ooppttiioonn ttccpp--kkeeeeppaalliivvee--iinntteerrvvaall _u_i_n_t_3_2;; ! This option specifies the interval (in seconds) that the ! client TCP should wait before sending a keepalive message ! on a TCP connection. The time is specified as a 32-bit ! unsigned integer. A value of zero indicates that the ! client should not generate keepalive messages on connec­ ! tions unless specifically requested by an application. ! ooppttiioonn ttccpp--kkeeeeppaalliivvee--ggaarrbbaaggee _f_l_a_g;; ! This option specifies the whether or not the client should ! send TCP keepalive messages with a octet of garbage for ! compatibility with older implementations. A value of 0 ! indicates that a garbage octet should not be sent. A value ! of 1 indicates that a garbage octet should be sent. ! ooppttiioonn nniiss--ddoommaaiinn _s_t_r_i_n_g;; ! This option specifies the name of the client's NIS (Sun ! Network Information Services) domain. The domain is for­ ! matted as a character string consisting of characters from ! the NVT ASCII character set. ! ooppttiioonn nniiss--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ... ];; ! This option specifies a list of IP addresses indicating ! NIS servers available to the client. Servers should be ! listed in order of preference. ! ooppttiioonn nnttpp--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ... ];; ! This option specifies a list of IP addresses indicating ! NTP (RFC 1035) servers available to the client. Servers ! should be listed in order of preference. ! ooppttiioonn nneettbbiiooss--nnaammee--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ... ];; ! The NetBIOS name server (NBNS) option specifies a list of ! RFC 1001/1002 NBNS name servers listed in order of prefer­ ! ence. ! ! ooppttiioonn nneettbbiiooss--dddd--sseerrvveerr _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ... ];; ! ! The NetBIOS datagram distribution server (NBDD) option --- 401,458 ---- ! encapsulation. A value of 1 means that the client ! should use RFC 1042 encapsulation. ! ooppttiioonn ddeeffaauulltt--ttccpp--ttttll _u_i_n_t_8;; ! This option specifies the default TTL that the client ! should use when sending TCP segments. The minimum ! value is 1. ! ooppttiioonn ttccpp--kkeeeeppaalliivvee--iinntteerrvvaall _u_i_n_t_3_2;; ! This option specifies the interval (in seconds) that ! the client TCP should wait before sending a keepalive ! message on a TCP connection. The time is specified as ! a 32-bit unsigned integer. A value of zero indicates ! that the client should not generate keepalive messages ! on connections unless specifically requested by an ! application. ! ooppttiioonn ttccpp--kkeeeeppaalliivvee--ggaarrbbaaggee _f_l_a_g;; ! This option specifies the whether or not the client ! should send TCP keepalive messages with a octet of ! garbage for compatibility with older implementations. ! A value of 0 indicates that a garbage octet should not ! be sent. A value of 1 indicates that a garbage octet ! should be sent. ! ooppttiioonn nniiss--ddoommaaiinn _s_t_r_i_n_g;; ! This option specifies the name of the client's NIS (Sun ! Network Information Services) domain. The domain is ! formatted as a character string consisting of charac­ ! ters from the NVT ASCII character set. ! ooppttiioonn nniiss--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; ! This option specifies a list of IP addresses indicating ! NIS servers available to the client. Servers should be ! listed in order of preference. ! ooppttiioonn nnttpp--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; ! This option specifies a list of IP addresses indicating ! NTP (RFC 1035) servers available to the client. ! Servers should be listed in order of preference. ! ooppttiioonn nneettbbiiooss--nnaammee--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; ! The NetBIOS name server (NBNS) option specifies a list ! of RFC 1001/1002 NBNS name servers listed in order of ! preference. NetBIOS Name Service is currently more ! commonly referred to as WINS. WINS servers can be *************** *** 467,518 **** ! specifies a list of RFC 1001/1002 NBDD servers listed in ! order of preference. ! ooppttiioonn nneettbbiiooss--nnooddee--ttyyppee _u_i_n_t_8;; ! The NetBIOS node type option allows NetBIOS over TCP/IP ! clients which are configurable to be configured as ! described in RFC 1001/1002. The value is specified as a ! single octet which identifies the client type. A value of ! 1 corresponds to a NetBIOS B-node; a value of 2 corre­ ! sponds to a P-node; a value of 4 corresponds to an M-node; ! a value of 8 corresponds to an H-node. ! ooppttiioonn nneettbbiiooss--ssccooppee _s_t_r_i_n_g;; ! The NetBIOS scope option specifies the NetBIOS over TCP/IP ! scope parameter for the client as specified in RFC ! 1001/1002. See RFC1001, RFC1002, and RFC1035 for charac­ ! ter-set restrictions. ! ooppttiioonn ffoonntt--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ... ];; ! This option specifies a list of X Window System Font ! servers available to the client. Servers should be listed ! in order of preference. - ooppttiioonn xx--ddiissppllaayy--mmaannaaggeerr _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s ... ];; - This option specifies a list of systems that are running - the X Window System Display Manager and are available to - the client. Addresses should be listed in order of pref­ - erence. - ooppttiioonn ddhhccpp--cclliieenntt--iiddeennttiiffiieerr _d_a_t_a_-_s_t_r_i_n_g;; ! This option can be used to specify the a DHCP client iden­ ! tifier in a host declaration, so that dhcpd can find the ! host record by matching against the client identifier. SSEEEE AALLSSOO ! dhcpd.conf(5), dhcpd.leases(5), dhclient.conf(5), dhcpd(8), dhclient(8), RFC2132, RFC2131. AAUUTTHHOORR ddhhccppdd((88)) was written by Ted Lemon under a ! contract with Vixie Labs. Funding for this project was ! provided by the Internet Software Corporation. Informa­ ! tion about the Internet Software Consortium can be found at hhttttpp::////wwwwww..iisscc..oorrgg//iisscc.. --- 467,545 ---- ! specified using the netbios-name-servers option. ! ! ooppttiioonn nneettbbiiooss--dddd--sseerrvveerr _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; ! ! The NetBIOS datagram distribution server (NBDD) option ! specifies a list of RFC 1001/1002 NBDD servers listed ! in order of preference. ! ! ooppttiioonn nneettbbiiooss--nnooddee--ttyyppee _u_i_n_t_8;; ! ! The NetBIOS node type option allows NetBIOS over TCP/IP ! clients which are configurable to be configured as ! described in RFC 1001/1002. The value is specified as ! a single octet which identifies the client type. ! ! Possible node types are: ! ! ! _1 B-node: Broadcast - no WINS ! ! _2 P-node: Peer - WINS only. ! ! _4 M-node: Mixed - broadcast, then WINS ! ! _8 H-node: Hybrid - WINS, then broadcast ! ! ooppttiioonn nneettbbiiooss--ssccooppee _s_t_r_i_n_g;; ! ! The NetBIOS scope option specifies the NetBIOS over ! TCP/IP scope parameter for the client as specified in ! RFC 1001/1002. See RFC1001, RFC1002, and RFC1035 for ! character-set restrictions. ! ooppttiioonn ffoonntt--sseerrvveerrss _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; ! This option specifies a list of X Window System Font ! servers available to the client. Servers should be ! listed in order of preference. ! ooppttiioonn xx--ddiissppllaayy--mmaannaaggeerr _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; ! This option specifies a list of systems that are run­ ! ning the X Window System Display Manager and are avail­ ! able to the client. Addresses should be listed in ! order of preference. ! ooppttiioonn ddhhccpp--cclliieenntt--iiddeennttiiffiieerr _d_a_t_a_-_s_t_r_i_n_g;; ! This option can be used to specify the a DHCP client ! identifier in a host declaration, so that dhcpd can ! find the host record by matching against the client ! identifier. ! ! 8 ! ! ! ! ! ! dhcpd-options(5) dhcpd-options(5) ! SSEEEE AALLSSOO ! dhcpd.conf(5), dhcpd.leases(5), dhclient.conf(5), dhcpd(8), dhclient(8), RFC2132, RFC2131. AAUUTTHHOORR ddhhccppdd((88)) was written by Ted Lemon under a ! contract with Vixie Labs. Funding for this project was ! provided by the Internet Software Corporation. Informa­ ! tion about the Internet Software Consortium can be found at hhttttpp::////wwwwww..iisscc..oorrgg//iisscc.. *************** *** 524,528 **** ! 8 --- 551,594 ---- ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! 9 diff -rNc2 dhcp-2.0b1pl6/common/dispatch.c dhcp-2.0b1pl18/common/dispatch.c *** dhcp-2.0b1pl6/common/dispatch.c Thu Jun 25 14:11:28 1998 --- dhcp-2.0b1pl18/common/dispatch.c Tue Feb 23 09:37:00 1999 *************** *** 4,9 **** /* ! * Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. ! * All rights reserved. * * Redistribution and use in source and binary forms, with or without --- 4,9 ---- /* ! * Copyright (c) 1995, 1996, 1997, 1998, 1999 ! * The Internet Software Consortium. All rights reserved. * * Redistribution and use in source and binary forms, with or without *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: dispatch.c,v 1.47.2.2 1998/06/25 21:11:28 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: dispatch.c,v 1.47.2.12 1999/02/23 17:37:00 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 49,53 **** #include ! struct interface_info *interfaces, *dummy_interfaces; struct protocol *protocols; struct timeout *timeouts; --- 49,53 ---- #include ! struct interface_info *interfaces, *dummy_interfaces, *fallback_interface; struct protocol *protocols; struct timeout *timeouts; *************** *** 58,62 **** struct iaddr, struct hardware *)); - static void got_one PROTO ((struct protocol *)); int quiet_interface_discovery; --- 58,61 ---- *************** *** 81,90 **** struct sockaddr_in foo; int ir; #ifdef ALIAS_NAMES_PERMUTED char *s; #endif - #ifdef USE_FALLBACK - static struct shared_network fallback_network; - #endif /* Create an unbound datagram socket to do the SIOCGIFADDR ioctl on. */ --- 80,87 ---- struct sockaddr_in foo; int ir; + struct ifreq *tif; #ifdef ALIAS_NAMES_PERMUTED char *s; #endif /* Create an unbound datagram socket to do the SIOCGIFADDR ioctl on. */ *************** *** 111,121 **** ir = INTERFACE_REQUESTED; ! /* Cycle through the list of interfaces looking for IP addresses. ! Go through twice; once to count the number of addresses, and a ! second time to copy them into an array of addresses. */ for (i = 0; i < ic.ifc_len;) { struct ifreq *ifp = (struct ifreq *)((caddr_t)ic.ifc_req + i); #ifdef HAVE_SA_LEN ! if (ifp -> ifr_addr.sa_len) i += (sizeof ifp -> ifr_name) + ifp -> ifr_addr.sa_len; else --- 108,116 ---- ir = INTERFACE_REQUESTED; ! /* Cycle through the list of interfaces looking for IP addresses. */ for (i = 0; i < ic.ifc_len;) { struct ifreq *ifp = (struct ifreq *)((caddr_t)ic.ifc_req + i); #ifdef HAVE_SA_LEN ! if (ifp -> ifr_addr.sa_len > sizeof (struct sockaddr)) i += (sizeof ifp -> ifr_name) + ifp -> ifr_addr.sa_len; else *************** *** 146,150 **** get a list of configurable interfaces. */ if ((ifr.ifr_flags & IFF_LOOPBACK) || ! #ifdef IFF_POINTOPOINT (ifr.ifr_flags & IFF_POINTOPOINT) || #endif --- 141,145 ---- get a list of configurable interfaces. */ if ((ifr.ifr_flags & IFF_LOOPBACK) || ! #ifdef HAVE_IFF_POINTOPOINT (ifr.ifr_flags & IFF_POINTOPOINT) || #endif *************** *** 174,178 **** /* If we have the capability, extract link information and record it in a linked list. */ ! #ifdef AF_LINK if (ifp -> ifr_addr.sa_family == AF_LINK) { struct sockaddr_dl *foo = ((struct sockaddr_dl *) --- 169,173 ---- /* If we have the capability, extract link information and record it in a linked list. */ ! #ifdef HAVE_AF_LINK if (ifp -> ifr_addr.sa_family == AF_LINK) { struct sockaddr_dl *foo = ((struct sockaddr_dl *) *************** *** 188,244 **** struct iaddr addr; - #if defined (SIOCGIFHWADDR) && !defined (AF_LINK) - struct ifreq ifr; - struct sockaddr sa; - int b, sk; - - /* Read the hardware address from this interface. */ - ifr = *ifp; - if (ioctl (sock, SIOCGIFHWADDR, &ifr) < 0) - error ("Can't get hardware address for %s: %m", - ifr.ifr_name); - - sa = *(struct sockaddr *)&ifr.ifr_hwaddr; - - switch (sa.sa_family) { - #ifdef ARPHRD_LOOPBACK - case ARPHRD_LOOPBACK: - /* ignore loopback interface */ - break; - #endif - - case ARPHRD_ETHER: - tmp -> hw_address.hlen = 6; - tmp -> hw_address.htype = ARPHRD_ETHER; - memcpy (tmp -> hw_address.haddr, - sa.sa_data, 6); - break; - - #ifndef ARPHRD_IEEE802 - # define ARPHRD_IEEE802 HTYPE_IEEE802 - #endif - case ARPHRD_IEEE802: - tmp -> hw_address.hlen = 6; - tmp -> hw_address.htype = ARPHRD_IEEE802; - memcpy (tmp -> hw_address.haddr, - sa.sa_data, 6); - break; - - #ifdef ARPHRD_METRICOM - case ARPHRD_METRICOM: - tmp -> hw_address.hlen = 6; - tmp -> hw_address.htype = ARPHRD_METRICOM; - memcpy (tmp -> hw_address.haddr, - sa.sa_data, 6); - - break; - #endif - - default: - error ("%s: unknown hardware address type %d", - ifr.ifr_name, sa.sa_family); - } - #endif /* defined (SIOCGIFHWADDR) && !defined (AF_LINK) */ - /* Get a pointer to the address... */ memcpy (&foo, &ifp -> ifr_addr, --- 183,186 ---- *************** *** 254,258 **** which we found it. */ if (!tmp -> ifp) { - struct ifreq *tif; #ifdef HAVE_SA_LEN int len = ((sizeof ifp -> ifr_name) + --- 196,199 ---- *************** *** 313,316 **** --- 254,405 ---- } + #if defined (LINUX_SLASHPROC_DISCOVERY) + /* On Linux, interfaces that don't have IP addresses don't show up + in the SIOCGIFCONF syscall. We got away with this prior to + Linux 2.1 because we would give each interface an IP address of + 0.0.0.0 before trying to boot, but that doesn't work after 2.1 + because we're using LPF, because we can't configure interfaces + with IP addresses of 0.0.0.0 anymore (grumble). This only + matters for the DHCP client, of course - the relay agent and + server should only care about interfaces that are configured + with IP addresses anyway. + + The PROCDEV_DEVICE (/proc/net/dev) is a kernel-supplied file + that, when read, prints a human readable network status. We + extract the names of the network devices by skipping the first + two lines (which are header) and then parsing off everything + up to the colon in each subsequent line - these lines start + with the interface name, then a colon, then a bunch of + statistics. Yes, Virgina, this is a kludge, but you work + with what you have. */ + + if (state == DISCOVER_UNCONFIGURED) { + FILE *proc_dev; + char buffer [256]; + int skip = 2; + + proc_dev = fopen (PROCDEV_DEVICE, "r"); + if (!proc_dev) + error ("%s: %m", PROCDEV_DEVICE); + + while (fgets (buffer, sizeof buffer, proc_dev)) { + char *name = buffer; + char *sep; + + /* Skip the first two blocks, which are header + lines. */ + if (skip) { + --skip; + continue; + } + + sep = strrchr (buffer, ':'); + if (sep) + *sep = '\0'; + while (*name == ' ') + name++; + + /* See if we've seen an interface that matches + this one. */ + for (tmp = interfaces; tmp; tmp = tmp -> next) + if (!strcmp (tmp -> name, name)) + break; + + /* If we found one, nothing more to do.. */ + if (tmp) + continue; + + /* Otherwise, allocate one. */ + tmp = ((struct interface_info *) + dmalloc (sizeof *tmp, "discover_interfaces")); + if (!tmp) + error ("Insufficient memory to %s %s", + "record interface", name); + memset (tmp, 0, sizeof *tmp); + strcpy (tmp -> name, name); + + tmp -> flags = ir; + tmp -> next = interfaces; + interfaces = tmp; + } + fclose (proc_dev); + } + #endif + + /* Now cycle through all the interfaces we found, looking for + hardware addresses. */ + #if defined (HAVE_SIOCGIFHWADDR) && !defined (HAVE_AF_LINK) + for (tmp = interfaces; tmp; tmp = tmp -> next) { + struct ifreq ifr; + struct sockaddr sa; + int b, sk; + + if (!tmp -> ifp) { + /* Make up an ifreq structure. */ + tif = (struct ifreq *)malloc (sizeof (struct ifreq)); + if (!tif) + error ("no space to remember ifp."); + memset (tif, 0, sizeof (struct ifreq)); + strcpy (tif -> ifr_name, tmp -> name); + tmp -> ifp = tif; + } + + /* Read the hardware address from this interface. */ + ifr = *tmp -> ifp; + if (ioctl (sock, SIOCGIFHWADDR, &ifr) < 0) + continue; + + sa = *(struct sockaddr *)&ifr.ifr_hwaddr; + + switch (sa.sa_family) { + #ifdef HAVE_ARPHRD_TUNNEL + case ARPHRD_TUNNEL: + /* ignore tunnel interfaces. */ + #endif + #ifdef HAVE_ARPHRD_LOOPBACK + case ARPHRD_LOOPBACK: + /* ignore loopback interface */ + break; + #endif + + case ARPHRD_ETHER: + tmp -> hw_address.hlen = 6; + tmp -> hw_address.htype = ARPHRD_ETHER; + memcpy (tmp -> hw_address.haddr, sa.sa_data, 6); + break; + + #ifndef ARPHRD_IEEE802 + # define ARPHRD_IEEE802 HTYPE_IEEE802 + #endif + case ARPHRD_IEEE802: + tmp -> hw_address.hlen = 6; + tmp -> hw_address.htype = ARPHRD_IEEE802; + memcpy (tmp -> hw_address.haddr, sa.sa_data, 6); + break; + + #ifndef ARPHRD_FDDI + # define ARPHRD_FDDI HTYPE_FDDI + #endif + case ARPHRD_FDDI: + tmp -> hw_address.hlen = 16; + tmp -> hw_address.htype = HTYPE_FDDI; /* XXX */ + memcpy (tmp -> hw_address.haddr, sa.sa_data, 16); + break; + + #ifdef HAVE_ARPHRD_METRICOM + case ARPHRD_METRICOM: + tmp -> hw_address.hlen = 6; + tmp -> hw_address.htype = ARPHRD_METRICOM; + memcpy (tmp -> hw_address.haddr, sa.sa_data, 6); + break; + #endif + + default: + error ("%s: unknown hardware address type %d", + ifr.ifr_name, sa.sa_family); + } + } + #endif /* defined (HAVE_SIOCGIFHWADDR) && !defined (HAVE_AF_LINK) */ + /* If we're just trying to get a list of interfaces that we might be able to configure, we can quit now. */ *************** *** 346,352 **** /* We must have a subnet declaration for each interface. */ ! if (!tmp -> shared_network && (state == DISCOVER_SERVER)) ! error ("No subnet declaration for %s (%s).", ! tmp -> name, inet_ntoa (foo.sin_addr)); /* Find subnets that don't have valid interface --- 435,445 ---- /* We must have a subnet declaration for each interface. */ ! if (!tmp -> shared_network && (state == DISCOVER_SERVER)) { ! warn ("No subnet declaration for %s (%s).", ! tmp -> name, inet_ntoa (foo.sin_addr)); ! warn ("Please write a subnet declaration for the %s", ! "network segment to"); ! error ("which interface %s is attached.", tmp -> name); ! } /* Find subnets that don't have valid interface *************** *** 376,387 **** close (sock); ! #ifdef USE_FALLBACK ! strcpy (fallback_interface.name, "fallback"); ! fallback_interface.shared_network = &fallback_network; ! fallback_network.name = "fallback-net"; ! if_register_fallback (&fallback_interface); ! add_protocol ("fallback", fallback_interface.wfdesc, ! fallback_discard, &fallback_interface); ! #endif } --- 469,492 ---- close (sock); ! maybe_setup_fallback (); ! } ! ! struct interface_info *setup_fallback () ! { ! fallback_interface = ! ((struct interface_info *) ! dmalloc (sizeof *fallback_interface, "discover_interfaces")); ! if (!fallback_interface) ! error ("Insufficient memory to record fallback interface."); ! memset (fallback_interface, 0, sizeof *fallback_interface); ! strcpy (fallback_interface -> name, "fallback"); ! fallback_interface -> shared_network = ! new_shared_network ("parse_statement"); ! if (!fallback_interface -> shared_network) ! error ("No memory for shared subnet"); ! memset (fallback_interface -> shared_network, 0, ! sizeof (struct shared_network)); ! fallback_interface -> shared_network -> name = "fallback-net"; ! return fallback_interface; } *************** *** 395,401 **** } ! #ifdef USE_FALLBACK ! if_reinitialize_fallback (&fallback_interface); ! #endif interfaces_invalidated = 1; --- 500,505 ---- } ! if (fallback_interface) ! if_reinitialize_send (fallback_interface); interfaces_invalidated = 1; *************** *** 403,416 **** #ifdef USE_POLL ! /* Wait for packets to come in using poll(). Anyway, when a packet ! comes in, call receive_packet to receive the packet and possibly ! strip hardware addressing information from it, and then call ! do_packet to try to do something with it. ! ! As you can see by comparing this with the code that uses select(), ! below, this is gratuitously complex. Quelle surprise, eh? This is ! SysV we're talking about, after all, and even in the 90's, it ! wouldn't do for SysV to make networking *easy*, would it? Rant, ! rant... */ void dispatch () --- 507,514 ---- #ifdef USE_POLL ! /* Wait for packets to come in using poll(). When a packet comes in, ! call receive_packet to receive the packet and possibly strip hardware ! addressing information from it, and then call through the ! bootp_packet_handler hook to try to do something with it. */ void dispatch () *************** *** 500,505 **** /* Wait for packets to come in using select(). When one does, call receive_packet to receive the packet and possibly strip hardware ! addressing information from it, and then call do_packet to try to ! do something with it. */ void dispatch () --- 598,603 ---- /* Wait for packets to come in using select(). When one does, call receive_packet to receive the packet and possibly strip hardware ! addressing information from it, and then call through the ! bootp_packet_handler hook to try to do something with it. */ void dispatch () *************** *** 567,571 **** #endif /* USE_POLL */ ! static void got_one (l) struct protocol *l; { --- 665,669 ---- #endif /* USE_POLL */ ! void got_one (l) struct protocol *l; { diff -rNc2 dhcp-2.0b1pl6/common/dlpi.c dhcp-2.0b1pl18/common/dlpi.c *** dhcp-2.0b1pl6/common/dlpi.c Sun Mar 15 22:11:03 1998 --- dhcp-2.0b1pl18/common/dlpi.c Sun Feb 28 09:10:52 1999 *************** *** 4,8 **** /* ! * Copyright (c) 1998 The Internet Software Consortium. * All rights reserved. * --- 4,8 ---- /* ! * Copyright (c) 1998, 1999 The Internet Software Consortium. * All rights reserved. * *************** *** 223,226 **** --- 223,229 ---- info -> hw_address.htype = HTYPE_ETHER; break; + case DL_FDDI: + info -> hw_address.htype = HTYPE_FDDI; + break; default: error ("%s: unknown DLPI MAC type %d", *************** *** 342,352 **** if (!quiet_interface_discovery) ! note ("Sending on DLPI/%s/%s/%s", info -> name, print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), (info -> shared_network ? ! info -> shared_network -> name : "unattached")); #ifdef DLPI_FIRST_SEND_WAIT --- 345,356 ---- if (!quiet_interface_discovery) ! note ("Sending on DLPI/%s/%s%s%s", info -> name, print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), + (info -> shared_network ? "/" : ""), (info -> shared_network ? ! info -> shared_network -> name : "")); #ifdef DLPI_FIRST_SEND_WAIT *************** *** 388,396 **** pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHLIT + ENF_CAND; pf.Pf_Filter [pf.Pf_FilterLen++] = htons (ETHERTYPE_IP); - pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHLIT; - pf.Pf_Filter [pf.Pf_FilterLen++] = htons (IPPROTO_UDP); pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHWORD + 11; pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSH00FF + ENF_AND; ! pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_CAND; pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHWORD + 18; pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHLIT + ENF_CAND; --- 392,403 ---- pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHLIT + ENF_CAND; pf.Pf_Filter [pf.Pf_FilterLen++] = htons (ETHERTYPE_IP); pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHWORD + 11; + #if defined(i386) || defined(__i386) + pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHFF00 + ENF_AND; + #else pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSH00FF + ENF_AND; ! #endif ! pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHLIT + ENF_CAND; ! pf.Pf_Filter [pf.Pf_FilterLen++] = htons (IPPROTO_UDP); pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHWORD + 18; pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHLIT + ENF_CAND; *************** *** 406,414 **** * of an IP packet. */ - pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHLIT; - pf.Pf_Filter [pf.Pf_FilterLen++] = htons (IPPROTO_UDP); pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHWORD + 4; pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSH00FF + ENF_AND; ! pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_CAND; pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHWORD + 11; pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHLIT + ENF_CAND; --- 413,424 ---- * of an IP packet. */ pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHWORD + 4; + #if defined(i386) || defined(__i386) + pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHFF00 + ENF_AND; + #else pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSH00FF + ENF_AND; ! #endif ! pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHLIT + ENF_CAND; ! pf.Pf_Filter [pf.Pf_FilterLen++] = htons (IPPROTO_UDP); pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHWORD + 11; pf.Pf_Filter [pf.Pf_FilterLen++] = ENF_PUSHLIT + ENF_CAND; *************** *** 424,434 **** if (!quiet_interface_discovery) ! note ("Listening on DLPI/%s/%s/%s", info -> name, print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), (info -> shared_network ? ! info -> shared_network -> name : "unattached")); #ifdef DLPI_FIRST_SEND_WAIT --- 434,445 ---- if (!quiet_interface_discovery) ! note ("Listening on DLPI/%s/%s%s%s", info -> name, print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), + (info -> shared_network ? "/" : ""), (info -> shared_network ? ! info -> shared_network -> name : "")); #ifdef DLPI_FIRST_SEND_WAIT *************** *** 459,463 **** unsigned addrlen; int saplen; ! int rslt; dbuflen = 0; --- 470,478 ---- unsigned addrlen; int saplen; ! int result; ! ! if (!strcmp (interface -> name, "fallback")) ! return send_fallback (interface, packet, raw, ! len, from, to, hto); dbuflen = 0; *************** *** 476,484 **** #ifdef USE_DLPI_RAW ! rslt = write (interface -> wfdesc, dbuf, dbuflen); #else /* XXX: Assumes ethernet, with two byte SAP */ ! sap [0] = 0; /* ETHERTYPE_IP, high byte */ ! sap [1] = 0x80; /* ETHERTYPE_IP, low byte */ saplen = -2; /* -2 indicates a two byte SAP at the end of the address */ --- 491,499 ---- #ifdef USE_DLPI_RAW ! result = write (interface -> wfdesc, dbuf, dbuflen); #else /* XXX: Assumes ethernet, with two byte SAP */ ! sap [0] = 0x08; /* ETHERTYPE_IP, high byte */ ! sap [1] = 0x0; /* ETHERTYPE_IP, low byte */ saplen = -2; /* -2 indicates a two byte SAP at the end of the address */ *************** *** 501,508 **** /* Send the packet down the wire... */ ! rslt = dlpiunitdatareq (interface -> wfdesc, dstaddr, addrlen, ! 0, 0, dbuf, dbuflen); #endif ! return rslt; } #endif /* USE_DLPI_SEND */ --- 516,525 ---- /* Send the packet down the wire... */ ! result = dlpiunitdatareq (interface -> wfdesc, dstaddr, addrlen, ! 0, 0, dbuf, dbuflen); #endif ! if (result < 0) ! warn ("send_packet: %m"); ! return result; } #endif /* USE_DLPI_SEND */ *************** *** 525,529 **** int offset = 0; int bufix = 0; - int rslt; #ifdef USE_DLPI_RAW --- 542,545 ---- *************** *** 1046,1050 **** struct strbuf ctl, data; int flags = 0; ! int rslt; /* Set up the msg_buf structure... */ --- 1062,1066 ---- struct strbuf ctl, data; int flags = 0; ! int result; /* Set up the msg_buf structure... */ *************** *** 1060,1066 **** data.buf = (char *)dbuf; ! rslt = getmsg (fd, &ctl, &data, &flags); ! if (rslt != 0) { return -1; } --- 1076,1082 ---- data.buf = (char *)dbuf; ! result = getmsg (fd, &ctl, &data, &flags); ! if (result != 0) { return -1; } *************** *** 1130,1134 **** int fd; { ! int rslt; #ifdef USE_POLL struct pollfd pfd; --- 1146,1150 ---- int fd; { ! int result; #ifdef USE_POLL struct pollfd pfd; *************** *** 1184,1189 **** */ *flagsp = 0; ! if ((rslt = getmsg (fd, ctlp, datap, flagsp)) < 0) { ! return rslt; } --- 1200,1205 ---- */ *flagsp = 0; ! if ((result = getmsg (fd, ctlp, datap, flagsp)) < 0) { ! return result; } *************** *** 1201,1205 **** * Check for MOREDATA and/or MORECTL. */ ! if (rslt & (MORECTL|MOREDATA)) { return -1; } --- 1217,1221 ---- * Check for MOREDATA and/or MORECTL. */ ! if (result & (MORECTL|MOREDATA)) { return -1; } *************** *** 1227,1229 **** --- 1243,1260 ---- #endif /* !defined (USE_POLL) */ + int can_unicast_without_arp () + { + return 1; + } + + void maybe_setup_fallback () + { + struct interface_info *fbi; + fbi = setup_fallback (); + if (fbi) { + if_register_fallback (fbi); + add_protocol ("fallback", fallback_interface -> wfdesc, + fallback_discard, fallback_interface); + } + } #endif /* USE_DLPI */ diff -rNc2 dhcp-2.0b1pl6/common/lpf.c dhcp-2.0b1pl18/common/lpf.c *** dhcp-2.0b1pl6/common/lpf.c Wed Dec 31 16:00:00 1969 --- dhcp-2.0b1pl18/common/lpf.c Tue Feb 23 14:09:55 1999 *************** *** 0 **** --- 1,293 ---- + /* lpf.c + + Linux packet filter code, contributed by Brian Murrel at Interlinx + Support Services in Vancouver, B.C. */ + + /* + * Copyright (c) 1995, 1996, 1998, 1999 + * 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 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 software has been written for the Internet Software Consortium + * by Ted Lemon in cooperation with Vixie + * Enterprises. To learn more about the Internet Software Consortium, + * see ``http://www.vix.com/isc''. To learn more about Vixie + * Enterprises, see ``http://www.vix.com''. + */ + + #ifndef lint + static char copyright[] = + "$Id: lpf.c,v 1.1.2.6 1999/02/23 22:09:55 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; + #endif /* not lint */ + + #include "dhcpd.h" + #if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE) + #include + #include + + #include + #include + #include + #include + #include "includes/netinet/ip.h" + #include "includes/netinet/udp.h" + #include "includes/netinet/if_ether.h" + + /* Reinitializes the specified interface after an address change. This + is not required for packet-filter APIs. */ + + #ifdef USE_LPF_SEND + void if_reinitialize_send (info) + struct interface_info *info; + { + } + #endif + + #ifdef USE_LPF_RECEIVE + void if_reinitialize_receive (info) + struct interface_info *info; + { + } + #endif + + /* Called by get_interface_list for each interface that's discovered. + Opens a packet filter for each interface and adds it to the select + mask. */ + + int if_register_lpf (info) + struct interface_info *info; + { + int sock; + char filename[50]; + int b; + struct sockaddr sa; + + /* Make an LPF socket. */ + if ((sock = socket(PF_PACKET, SOCK_PACKET, htons(ETH_P_ALL))) < 0) { + if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || + errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || + errno == EAFNOSUPPORT) + error ("socket: %m - make sure %s %s!", + "CONFIG_PACKET and CONFIG_FILTER are defined", + "in your kernel configuration"); + error("Open a socket for LPF: %m"); + } + + /* Bind to the interface name */ + memset (&sa, 0, sizeof sa); + sa.sa_family = AF_PACKET; + strncpy (sa.sa_data, (const char *)info -> ifp, sizeof sa.sa_data); + if (bind (sock, &sa, sizeof sa)) { + if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || + errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || + errno == EAFNOSUPPORT) + error ("socket: %m - make sure %s %s!", + "CONFIG_PACKET and CONFIG_FILTER are defined", + "in your kernel configuration"); + error("Bind socket to interface: %m"); + } + + return sock; + } + #endif /* USE_LPF_SEND || USE_LPF_RECEIVE */ + + #ifdef USE_LPF_SEND + void if_register_send (info) + struct interface_info *info; + { + /* If we're using the lpf API for sending and receiving, + we don't need to register this interface twice. */ + #ifndef USE_LPF_RECEIVE + info -> wfdesc = if_register_lpf (info, interface); + #else + info -> wfdesc = info -> rfdesc; + #endif + if (!quiet_interface_discovery) + note ("Sending on LPF/%s/%s%s%s", + info -> name, + print_hw_addr (info -> hw_address.htype, + info -> hw_address.hlen, + info -> hw_address.haddr), + (info -> shared_network ? "/" : ""), + (info -> shared_network ? + info -> shared_network -> name : "")); + } + #endif /* USE_LPF_SEND */ + + #ifdef USE_LPF_RECEIVE + /* Defined in bpf.c. We can't extern these in dhcpd.h without pulling + in bpf includes... */ + extern struct sock_filter dhcp_bpf_filter []; + extern int dhcp_bpf_filter_len; + + void if_register_receive (info) + struct interface_info *info; + { + struct sock_fprog p; + + /* Open a LPF device and hang it on this interface... */ + info -> rfdesc = if_register_lpf (info); + + /* Set up the bpf filter program structure. This is defined in + bpf.c */ + p.len = dhcp_bpf_filter_len; + p.filter = dhcp_bpf_filter; + + /* Patch the server port into the LPF program... + XXX changes to filter program may require changes + to the insn number(s) used below! XXX */ + dhcp_bpf_filter [8].k = ntohs (local_port); + + if (setsockopt (info -> rfdesc, SOL_SOCKET, SO_ATTACH_FILTER, &p, + sizeof p) < 0) { + if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || + errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || + errno == EAFNOSUPPORT) + error ("socket: %m - make sure %s %s!", + "CONFIG_PACKET and CONFIG_FILTER are defined", + "in your kernel configuration"); + error ("Can't install packet filter program: %m"); + } + if (!quiet_interface_discovery) + note ("Listening on LPF/%s/%s%s%s", + info -> name, + print_hw_addr (info -> hw_address.htype, + info -> hw_address.hlen, + info -> hw_address.haddr), + (info -> shared_network ? "/" : ""), + (info -> shared_network ? + info -> shared_network -> name : "")); + } + #endif /* USE_LPF_RECEIVE */ + + #ifdef USE_LPF_SEND + ssize_t send_packet (interface, packet, raw, len, from, to, hto) + struct interface_info *interface; + struct packet *packet; + struct dhcp_packet *raw; + size_t len; + struct in_addr from; + struct sockaddr_in *to; + struct hardware *hto; + { + int bufp = 0; + unsigned char buf [1500]; + struct sockaddr sa; + int result; + + if (!strcmp (interface -> name, "fallback")) + return send_fallback (interface, packet, raw, + len, from, to, hto); + + /* Assemble the headers... */ + assemble_hw_header (interface, buf, &bufp, hto); + assemble_udp_ip_header (interface, buf, &bufp, from.s_addr, + to -> sin_addr.s_addr, to -> sin_port, + (unsigned char *)raw, len); + memcpy (buf + bufp, raw, len); + + /* For some reason, SOCK_PACKET sockets can't be connected, + so we have to do a sentdo every time. */ + memset (&sa, 0, sizeof sa); + sa.sa_family = AF_PACKET; + strncpy (sa.sa_data, + (const char *)interface -> ifp, sizeof sa.sa_data); + + result = sendto (interface -> wfdesc, buf, bufp + len, 0, + &sa, sizeof sa); + if (result < 0) + warn ("send_packet: %m"); + return result; + } + #endif /* USE_LPF_SEND */ + + #ifdef USE_LPF_RECEIVE + ssize_t receive_packet (interface, buf, len, from, hfrom) + struct interface_info *interface; + unsigned char *buf; + size_t len; + struct sockaddr_in *from; + struct hardware *hfrom; + { + int nread; + int length = 0; + int offset = 0; + unsigned char ibuf [1500]; + int bufix = 0; + + length = read (interface -> rfdesc, ibuf, sizeof ibuf); + if (length <= 0) + return length; + + bufix = 0; + /* Decode the physical header... */ + offset = decode_hw_header (interface, ibuf, bufix, hfrom); + + /* If a physical layer checksum failed (dunno of any + physical layer that supports this, but WTH), skip this + packet. */ + if (offset < 0) { + return 0; + } + + bufix += offset; + length -= offset; + + /* Decode the IP and UDP headers... */ + offset = decode_udp_ip_header (interface, ibuf, bufix, + from, (unsigned char *)0, length); + + /* If the IP or UDP checksum was bad, skip the packet... */ + if (offset < 0) + return 0; + + bufix += offset; + length -= offset; + + /* Copy out the data in the packet... */ + memcpy (buf, &ibuf [bufix], length); + return length; + } + + int can_unicast_without_arp () + { + return 1; + } + + void maybe_setup_fallback () + { + struct interface_info *fbi; + fbi = setup_fallback (); + if (fbi) { + if_register_fallback (fbi); + add_protocol ("fallback", fallback_interface -> wfdesc, + fallback_discard, fallback_interface); + } + } + #endif diff -rNc2 dhcp-2.0b1pl6/common/memory.c dhcp-2.0b1pl18/common/memory.c *** dhcp-2.0b1pl6/common/memory.c Thu Jun 25 14:11:30 1998 --- dhcp-2.0b1pl18/common/memory.c Tue Nov 24 14:32:43 1998 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: memory.c,v 1.35.2.2 1998/06/25 21:11:30 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: memory.c,v 1.35.2.3 1998/11/24 22:32:43 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 358,361 **** --- 358,390 ---- } + int subnet_inner_than (subnet, scan, warnp) + struct subnet *subnet, *scan; + int warnp; + { + if (addr_eq (subnet_number (subnet -> net, scan -> netmask), + scan -> net) || + addr_eq (subnet_number (scan -> net, subnet -> netmask), + subnet -> net)) { + char n1buf [16]; + int i, j; + for (i = 0; i < 32; i++) + if (subnet -> netmask.iabuf [3 - (i >> 3)] + & (1 << (i & 7))) + break; + for (j = 0; j < 32; j++) + if (scan -> netmask.iabuf [3 - (j >> 3)] & + (1 << (j & 7))) + break; + strcpy (n1buf, piaddr (subnet -> net)); + if (warnp) + warn ("%ssubnet %s/%d conflicts with subnet %s/%d", + "Warning: ", n1buf, 32 - i, + piaddr (scan -> net), 32 - j); + if (i < j) + return 1; + } + return 0; + } + /* Enter a new subnet into the subnet list. */ *************** *** 363,391 **** struct subnet *subnet; { ! struct subnet *scan; /* Check for duplicates... */ for (scan = subnets; scan; scan = scan -> next_subnet) { ! if (addr_eq (subnet_number (subnet -> net, scan -> netmask), ! scan -> net) || ! addr_eq (subnet_number (scan -> net, subnet -> netmask), ! subnet -> net)) { ! char n1buf [16]; ! int i, j; ! for (i = 0; i < 32; i++) ! if (subnet -> netmask.iabuf [3 - (i >> 3)] ! & (1 << (i & 7))) ! break; ! for (j = 0; j < 32; j++) ! if (scan -> netmask.iabuf [3 - (j >> 3)] ! & (1 << (j & 7))) ! break; ! strcpy (n1buf, piaddr (subnet -> net)); ! error ("subnet %s/%d conflicts with subnet %s/%d", ! n1buf, i, piaddr (scan -> net), j); } } ! /* XXX Sort the nets into a balanced tree to make searching quicker. */ subnet -> next_subnet = subnets; subnets = subnet; --- 392,414 ---- struct subnet *subnet; { ! struct subnet *scan, *prev = (struct subnet *)0; /* Check for duplicates... */ for (scan = subnets; scan; scan = scan -> next_subnet) { ! /* When we find a conflict, make sure that the ! subnet with the narrowest subnet mask comes ! first. */ ! if (subnet_inner_than (subnet, scan, 1)) { ! if (prev) { ! prev -> next_subnet = subnet; ! } else ! subnets = subnet; ! subnet -> next_subnet = scan; ! return; } + prev = scan; } ! /* XXX use the BSD radix tree code instead of a linked list. */ subnet -> next_subnet = subnets; subnets = subnet; *************** *** 627,632 **** lt = *lease; ! lt.ends = cur_time; ! supersede_lease (lease, <, 1); } --- 650,657 ---- lt = *lease; ! if (lt.ends > cur_time) { ! lt.ends = cur_time; ! supersede_lease (lease, <, 1); ! } } *************** *** 897,911 **** struct subnet *n; for (s = shared_networks; s; s = s -> next) { ! for (n = subnets; n; n = n -> next_sibling) { ! debug ("Subnet %s", piaddr (n -> net)); ! debug (" netmask %s", ! piaddr (n -> netmask)); ! } for (l = s -> leases; l; l = l -> next) { print_lease (l); } ! debug ("Last Lease:"); ! print_lease (s -> last_lease); } } --- 922,941 ---- struct subnet *n; + note ("Subnets:"); + for (n = subnets; n; n = n -> next_subnet) { + debug (" Subnet %s", piaddr (n -> net)); + debug (" netmask %s", + piaddr (n -> netmask)); + } + note ("Shared networks:"); for (s = shared_networks; s; s = s -> next) { ! note (" %s", s -> name); for (l = s -> leases; l; l = l -> next) { print_lease (l); } ! if (s -> last_lease) { ! debug (" Last Lease:"); ! print_lease (s -> last_lease); ! } } } diff -rNc2 dhcp-2.0b1pl6/common/nit.c dhcp-2.0b1pl18/common/nit.c *** dhcp-2.0b1pl6/common/nit.c Mon Oct 20 14:47:13 1997 --- dhcp-2.0b1pl18/common/nit.c Tue Feb 23 14:09:54 1999 *************** *** 5,9 **** /* ! * Copyright (c) 1996 The Internet Software Consortium. * All rights reserved. * --- 5,9 ---- /* ! * Copyright (c) 1996, 1998, 1999 The Internet Software Consortium. * All rights reserved. * *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: nit.c,v 1.15 1997/10/20 21:47:13 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: nit.c,v 1.15.2.3 1999/02/23 22:09:54 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 156,165 **** #endif if (!quiet_interface_discovery) ! note ("Sending on NIT/%s/%s", print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), (info -> shared_network ? ! info -> shared_network -> name : "unattached")); } #endif /* USE_NIT_SEND */ --- 156,166 ---- #endif if (!quiet_interface_discovery) ! note ("Sending on NIT/%s%s%s", print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), + (info -> shared_network ? "/" : ""), (info -> shared_network ? ! info -> shared_network -> name : "")); } #endif /* USE_NIT_SEND */ *************** *** 239,248 **** if (!quiet_interface_discovery) ! note ("Listening on NIT/%s/%s", print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), (info -> shared_network ? ! info -> shared_network -> name : "unattached")); } #endif /* USE_NIT_RECEIVE */ --- 240,250 ---- if (!quiet_interface_discovery) ! note ("Listening on NIT/%s%s%s", print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), + (info -> shared_network ? "/" : ""), (info -> shared_network ? ! info -> shared_network -> name : "")); } #endif /* USE_NIT_RECEIVE */ *************** *** 264,267 **** --- 266,274 ---- int hw_end; struct sockaddr_in foo; + int result; + + if (!strcmp (interface -> name, "fallback")) + return send_fallback (interface, packet, raw, + len, from, to, hto); /* Start with the sockaddr struct... */ *************** *** 295,299 **** data.maxlen = data.len = bufp + len - hw_end; ! return putmsg (interface -> wfdesc, &ctl, &data, 0); } #endif /* USE_NIT_SEND */ --- 302,309 ---- data.maxlen = data.len = bufp + len - hw_end; ! result = putmsg (interface -> wfdesc, &ctl, &data, 0); ! if (result < 0) ! warn ("send_packet: %m"); ! return result; } #endif /* USE_NIT_SEND */ *************** *** 344,347 **** --- 354,373 ---- memcpy (buf, &ibuf [bufix], length); return length; + } + + int can_unicast_without_arp () + { + return 1; + } + + void maybe_setup_fallback () + { + struct interface_info *fbi; + fbi = setup_fallback (); + if (fbi) { + if_register_fallback (fbi); + add_protocol ("fallback", fallback_interface -> wfdesc, + fallback_discard, fallback_interface); + } } #endif diff -rNc2 dhcp-2.0b1pl6/common/parse.c dhcp-2.0b1pl18/common/parse.c *** dhcp-2.0b1pl6/common/parse.c Thu Jun 25 14:11:31 1998 --- dhcp-2.0b1pl18/common/parse.c Tue Dec 22 14:43:22 1998 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: parse.c,v 1.2.2.1 1998/06/25 21:11:31 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: parse.c,v 1.2.2.3 1998/12/22 22:43:22 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 223,226 **** --- 223,229 ---- hardware -> htype = HTYPE_IEEE802; break; + case FDDI: + hardware -> htype = HTYPE_FDDI; + break; default: parse_warn ("expecting a network hardware type"); *************** *** 248,251 **** --- 251,257 ---- memcpy ((unsigned char *)&hardware -> haddr [0], t, hardware -> hlen); + if (hlen < sizeof hardware -> haddr) + memset (&hardware -> haddr [hlen], 0, + (sizeof hardware -> haddr) - hlen); free (t); } diff -rNc2 dhcp-2.0b1pl6/common/print.c dhcp-2.0b1pl18/common/print.c *** dhcp-2.0b1pl6/common/print.c Thu Jun 25 14:11:31 1998 --- dhcp-2.0b1pl18/common/print.c Sat Feb 13 11:19:03 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: print.c,v 1.16.2.1 1998/06/25 21:11:31 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: print.c,v 1.16.2.3 1999/02/13 19:19:03 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 77,100 **** char tbuf [32]; ! debug (" Lease %s", piaddr (lease -> ip_addr)); t = gmtime (&lease -> starts); ! strftime (tbuf, sizeof tbuf, "%D %H:%M:%S", t); ! debug (" start %s", tbuf); t = gmtime (&lease -> ends); ! strftime (tbuf, sizeof tbuf, "%D %H:%M:%S", t); ! debug (" end %s", tbuf); t = gmtime (&lease -> timestamp); ! strftime (tbuf, sizeof tbuf, "%D %H:%M:%S", t); ! debug (" stamp %s", tbuf); ! debug (" hardware addr = %s", print_hw_addr (lease -> hardware_addr.htype, lease -> hardware_addr.hlen, lease -> hardware_addr.haddr)); ! debug (" host %s ", lease -> host ? lease -> host -> name : ""); } --- 77,100 ---- char tbuf [32]; ! debug (" Lease %s", piaddr (lease -> ip_addr)); t = gmtime (&lease -> starts); ! strftime (tbuf, sizeof tbuf, "%Y/%m/%d %H:%M:%S", t); ! debug (" start %s", tbuf); t = gmtime (&lease -> ends); ! strftime (tbuf, sizeof tbuf, "%Y/%m/%d %H:%M:%S", t); ! debug (" end %s", tbuf); t = gmtime (&lease -> timestamp); ! strftime (tbuf, sizeof tbuf, "%Y/%m/%d %H:%M:%S", t); ! debug (" stamp %s", tbuf); ! debug (" hardware addr = %s", print_hw_addr (lease -> hardware_addr.htype, lease -> hardware_addr.hlen, lease -> hardware_addr.haddr)); ! debug (" host %s ", lease -> host ? lease -> host -> name : ""); } diff -rNc2 dhcp-2.0b1pl6/common/raw.c dhcp-2.0b1pl18/common/raw.c *** dhcp-2.0b1pl6/common/raw.c Mon Oct 20 14:47:14 1997 --- dhcp-2.0b1pl18/common/raw.c Tue Feb 23 14:09:54 1999 *************** *** 17,21 **** /* ! * Copyright (c) 1995, 1996 The Internet Software Consortium. * All rights reserved. * --- 17,21 ---- /* ! * Copyright (c) 1995, 1996, 1997, 1999 The Internet Software Consortium. * All rights reserved. * *************** *** 55,59 **** #ifndef lint static char copyright[] = ! "$Id: raw.c,v 1.11 1997/10/20 21:47:14 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 55,59 ---- #ifndef lint static char copyright[] = ! "$Id: raw.c,v 1.11.2.2 1999/02/23 22:09:54 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 98,105 **** info -> wfdesc = sock; if (!quiet_interface_discovery) ! note ("Sending on Raw/%s/%s", info -> name, (info -> shared_network ? ! info -> shared_network -> name : "unattached")); } --- 98,106 ---- info -> wfdesc = sock; if (!quiet_interface_discovery) ! note ("Sending on Raw/%s%s%s", info -> name, + (info -> shared_network ? "/" : ""), (info -> shared_network ? ! info -> shared_network -> name : "")); } *************** *** 116,119 **** --- 117,121 ---- int bufp = 0; struct iovec iov [2]; + int result; /* Assemble the headers... */ *************** *** 128,132 **** iov [1].iov_len = len; ! return writev(interface -> wfdesc, iov, 2); } #endif /* USE_SOCKET_SEND */ --- 130,137 ---- iov [1].iov_len = len; ! result = writev(interface -> wfdesc, iov, 2); ! if (result < 0) ! warn ("send_packet: %m"); ! return result; } #endif /* USE_SOCKET_SEND */ diff -rNc2 dhcp-2.0b1pl6/common/socket.c dhcp-2.0b1pl18/common/socket.c *** dhcp-2.0b1pl6/common/socket.c Thu Jun 25 14:11:32 1998 --- dhcp-2.0b1pl18/common/socket.c Tue Feb 23 14:09:55 1999 *************** *** 4,9 **** /* ! * Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. ! * All rights reserved. * * Redistribution and use in source and binary forms, with or without --- 4,9 ---- /* ! * Copyright (c) 1995, 1996, 1997, 1998, 1999 ! * The Internet Software Consortium. All rights reserved. * * Redistribution and use in source and binary forms, with or without *************** *** 51,55 **** #ifndef lint static char copyright[] = ! "$Id: socket.c,v 1.26.2.2 1998/06/25 21:11:32 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 51,55 ---- #ifndef lint static char copyright[] = ! "$Id: socket.c,v 1.26.2.10 1999/02/23 22:09:55 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 103,107 **** int flag; ! #ifndef SO_BINDTODEVICE /* Make sure only one interface is registered. */ if (once) --- 103,107 ---- int flag; ! #if !defined (HAVE_SO_BINDTODEVICE) && !defined (USE_FALLBACK) /* Make sure only one interface is registered. */ if (once) *************** *** 137,145 **** error ("Can't bind to dhcp address: %m"); ! #ifdef SO_BINDTODEVICE /* Bind this socket to this interface. */ ! if (setsockopt (sock, SOL_SOCKET, SO_BINDTODEVICE, (char *)(info -> ifp), sizeof *(info -> ifp)) < 0) { ! error("setting SO_BINDTODEVICE"); } #endif --- 137,146 ---- error ("Can't bind to dhcp address: %m"); ! #if defined (HAVE_SO_BINDTODEVICE) /* Bind this socket to this interface. */ ! if (info -> ifp && ! setsockopt (sock, SOL_SOCKET, SO_BINDTODEVICE, (char *)(info -> ifp), sizeof *(info -> ifp)) < 0) { ! error("setsockopt: SO_BINDTODEVICE: %m"); } #endif *************** *** 159,167 **** #endif if (!quiet_interface_discovery) ! note ("Sending on Socket/%s/%s", info -> name, (info -> shared_network ? ! info -> shared_network -> name : "unattached")); ! } #endif /* USE_SOCKET_SEND */ --- 160,168 ---- #endif if (!quiet_interface_discovery) ! note ("Sending on Socket/%s%s%s", info -> name, + (info -> shared_network ? "/" : ""), (info -> shared_network ? ! info -> shared_network -> name : "")); } #endif /* USE_SOCKET_SEND */ *************** *** 175,182 **** info -> rfdesc = if_register_socket (info); if (!quiet_interface_discovery) ! note ("Listening on Socket/%s/%s", info -> name, (info -> shared_network ? ! info -> shared_network -> name : "unattached")); } #endif /* USE_SOCKET_RECEIVE */ --- 176,184 ---- info -> rfdesc = if_register_socket (info); if (!quiet_interface_discovery) ! note ("Listening on Socket/%s%s%s", info -> name, + (info -> shared_network ? "/" : ""), (info -> shared_network ? ! info -> shared_network -> name : "")); } #endif /* USE_SOCKET_RECEIVE */ *************** *** 206,209 **** --- 208,217 ---- retry++ < 10); #endif + if (result < 0) { + warn ("send_packet: %m"); + if (errno == ENETUNREACH) + warn ("send_packet: please consult README file %s", + "regarding broadcast address."); + } return result; } *************** *** 237,241 **** #endif /* USE_SOCKET_RECEIVE */ ! #ifdef USE_SOCKET_FALLBACK /* This just reads in a packet and silently discards it. */ --- 245,249 ---- #endif /* USE_SOCKET_RECEIVE */ ! #ifdef USE_SOCKET_SEND /* This just reads in a packet and silently discards it. */ *************** *** 254,256 **** warn ("fallback_discard: %m"); } ! #endif /* USE_SOCKET_RECEIVE */ --- 262,287 ---- warn ("fallback_discard: %m"); } ! #endif /* USE_SOCKET_SEND */ ! ! #if defined (USE_SOCKET_SEND) && !defined (USE_SOCKET_FALLBACK) ! int can_unicast_without_arp () ! { ! return 0; ! } ! ! /* If we have SO_BINDTODEVICE, set up a fallback interface; otherwise, ! do not. */ ! ! void maybe_setup_fallback () ! { ! #if defined (SO_BINDTODEVICE) ! struct interface_info *fbi; ! fbi = setup_fallback (); ! if (fbi) { ! fbi -> wfdesc = if_register_socket (fbi); ! add_protocol ("fallback", ! fbi -> wfdesc, fallback_discard, fbi); ! } ! #endif ! } ! #endif /* USE_SOCKET_SEND && !USE_SOCKET_FALLBACK */ diff -rNc2 dhcp-2.0b1pl6/common/tables.c dhcp-2.0b1pl18/common/tables.c *** dhcp-2.0b1pl6/common/tables.c Thu Jun 25 14:11:32 1998 --- dhcp-2.0b1pl18/common/tables.c Tue Dec 22 14:45:44 1998 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: tables.c,v 1.13.2.1 1998/06/25 21:11:32 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: tables.c,v 1.13.2.3 1998/12/22 22:45:44 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 79,83 **** { "impress-servers", "IA", &dhcp_universe, 10 }, { "resource-location-servers", "IA", &dhcp_universe, 11 }, ! { "host-name", "t", &dhcp_universe, 12 }, { "boot-size", "S", &dhcp_universe, 13 }, { "merit-dump", "t", &dhcp_universe, 14 }, --- 79,83 ---- { "impress-servers", "IA", &dhcp_universe, 10 }, { "resource-location-servers", "IA", &dhcp_universe, 11 }, ! { "host-name", "X", &dhcp_universe, 12 }, { "boot-size", "S", &dhcp_universe, 13 }, { "merit-dump", "t", &dhcp_universe, 14 }, *************** *** 419,423 **** "token-ring", "unknown-7", ! "unknown-8", "unknown-9", "unknown-10", --- 419,423 ---- "token-ring", "unknown-7", ! "fddi", "unknown-9", "unknown-10", diff -rNc2 dhcp-2.0b1pl6/common/upf.c dhcp-2.0b1pl18/common/upf.c *** dhcp-2.0b1pl6/common/upf.c Mon Oct 20 14:47:15 1997 --- dhcp-2.0b1pl18/common/upf.c Tue Feb 23 14:09:56 1999 *************** *** 4,9 **** /* ! * Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. ! * All rights reserved. * * Redistribution and use in source and binary forms, with or without --- 4,9 ---- /* ! * Copyright (c) 1995, 1996, 1997, 1998, 1999 ! * The Internet Software Consortium. All rights reserved. * * Redistribution and use in source and binary forms, with or without *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: upf.c,v 1.3 1997/10/20 21:47:15 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: upf.c,v 1.3.2.3 1999/02/23 22:09:56 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 144,154 **** #endif if (!quiet_interface_discovery) ! note ("Sending on UPF/%s/%s/%s", info -> name, print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), (info -> shared_network ? ! info -> shared_network -> name : "unattached")); } #endif /* USE_UPF_SEND */ --- 144,155 ---- #endif if (!quiet_interface_discovery) ! note ("Sending on UPF/%s/%s%s%s", info -> name, print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), + (info -> shared_network ? "/" : ""), (info -> shared_network ? ! info -> shared_network -> name : "")); } #endif /* USE_UPF_SEND */ *************** *** 209,219 **** error ("Can't install packet filter program: %m"); if (!quiet_interface_discovery) ! note ("Listening on UPF/%s/%s/%s", info -> name, print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), (info -> shared_network ? ! info -> shared_network -> name : "unattached")); } #endif /* USE_UPF_RECEIVE */ --- 210,221 ---- error ("Can't install packet filter program: %m"); if (!quiet_interface_discovery) ! note ("Listening on UPF/%s/%s%s%s", info -> name, print_hw_addr (info -> hw_address.htype, info -> hw_address.hlen, info -> hw_address.haddr), + (info -> shared_network ? "/" : ""), (info -> shared_network ? ! info -> shared_network -> name : "")); } #endif /* USE_UPF_RECEIVE */ *************** *** 232,235 **** --- 234,242 ---- unsigned char buf [256]; struct iovec iov [2]; + int result; + + if (!strcmp (interface -> name, "fallback")) + return send_fallback (interface, packet, raw, + len, from, to, hto); /* Assemble the headers... */ *************** *** 245,249 **** iov [1].iov_len = len; ! return writev(interface -> wfdesc, iov, 2); } #endif /* USE_UPF_SEND */ --- 252,259 ---- iov [1].iov_len = len; ! result = writev(interface -> wfdesc, iov, 2); ! if (result < 0) ! warn ("send_packet: %m"); ! return result; } #endif /* USE_UPF_SEND */ *************** *** 295,298 **** --- 305,324 ---- memcpy (buf, &ibuf [bufix], length); return length; + } + + int can_unicast_without_arp () + { + return 1; + } + + void maybe_setup_fallback () + { + struct interface_info *fbi; + fbi = setup_fallback (); + if (fbi) { + if_register_fallback (fbi); + add_protocol ("fallback", fallback_interface -> wfdesc, + fallback_discard, fallback_interface); + } } #endif diff -rNc2 dhcp-2.0b1pl6/configure dhcp-2.0b1pl18/configure *** dhcp-2.0b1pl6/configure Thu Jun 25 11:34:46 1998 --- dhcp-2.0b1pl18/configure Wed Feb 3 10:53:36 1999 *************** *** 22,25 **** --- 22,26 ---- 1*) sysname=linux-1 ;; 2.1*) sysname=linux-2.1 ;; + 2.2*) sysname=linux-2.2 ;; 2*) sysname=linux-2.0 ;; esac;; diff -rNc2 dhcp-2.0b1pl6/includes/cf/freebsd.h dhcp-2.0b1pl18/includes/cf/freebsd.h *** dhcp-2.0b1pl6/includes/cf/freebsd.h Fri May 9 01:18:37 1997 --- dhcp-2.0b1pl18/includes/cf/freebsd.h Fri Jul 10 17:36:04 1998 *************** *** 4,8 **** /* ! * Copyright (c) 1996 The Internet Software Consortium. All rights reserved. * * Redistribution and use in source and binary forms, with or without --- 4,9 ---- /* ! * Copyright (c) 1996, 1998 The Internet Software Consortium. ! * All rights reserved. * * Redistribution and use in source and binary forms, with or without *************** *** 54,58 **** #include #include ! #define INADDR_LOOPBACK ((u_int32_t)0x7f000001) /* Varargs stuff... */ --- 55,62 ---- #include #include ! #include ! #if !defined (INADDR_LOOPBACK) ! # define INADDR_LOOPBACK ((u_int32_t)0x7f000001) ! #endif /* Varargs stuff... */ diff -rNc2 dhcp-2.0b1pl6/includes/cf/linux.h dhcp-2.0b1pl18/includes/cf/linux.h *** dhcp-2.0b1pl6/includes/cf/linux.h Sun May 17 22:30:21 1998 --- dhcp-2.0b1pl18/includes/cf/linux.h Sat Feb 27 13:44:26 1999 *************** *** 6,10 **** /* ! * Copyright (c) 1996, 1998 The Internet Software Consortium. * All rights reserved. * --- 6,10 ---- /* ! * Copyright (c) 1996, 1998, 1999 The Internet Software Consortium. * All rights reserved. * *************** *** 49,52 **** --- 49,56 ---- #endif /* __BIT_TYPES_DEFINED__ */ + typedef u_int8_t u8; + typedef u_int16_t u16; + typedef u_int32_t u32; + #include #include *************** *** 64,68 **** #include ! #if defined (LINUX_1_X) # include # include /* also necessary */ --- 68,72 ---- #include ! #if LINUX_MAJOR == 1 # include # include /* also necessary */ *************** *** 73,84 **** #include /* gettimeofday()*/ ! #ifndef _PATH_DHCPD_PID ! #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" ! #endif ! #ifndef _PATH_DHCLIENT_PID ! #define _PATH_DHCLIENT_PID "/var/run/dhclient.pid" #endif #ifndef _PATH_DHCLIENT_DB ! #define _PATH_DHCLIENT_DB "/var/db/dhclient.leases" #endif --- 77,93 ---- #include /* gettimeofday()*/ ! /* Databases go in /var/state/dhcp. It would also be valid to put them ! in /var/state/misc - indeed, given that there's only one lease file, it ! would probably be better. However, I have some ideas for optimizing ! the lease database that may result in a _lot_ of smaller files being ! created, so in that context it makes more sense to have a seperate ! directory. */ ! ! #ifndef _PATH_DHCPD_DB ! #define _PATH_DHCPD_DB "/var/state/dhcp/dhcpd.leases" #endif + #ifndef _PATH_DHCLIENT_DB ! #define _PATH_DHCLIENT_DB "/var/state/dhcp/dhclient.leases" #endif *************** *** 103,109 **** #define GET_TIME(x) time ((x)) ! #if defined (USE_DEFAULT_NETWORK) # define USE_SOCKETS ! # define IGNORE_HOSTUNREACH #endif --- 112,136 ---- #define GET_TIME(x) time ((x)) ! #if (LINUX_MAJOR >= 2) ! # if (LINUX_MINOR >= 1) ! # if defined (USE_DEFAULT_NETWORK) ! # define USE_LPF ! # endif ! # define LINUX_SLASHPROC_DISCOVERY ! # define PROCDEV_DEVICE "/proc/net/dev" ! # define HAVE_ARPHRD_TUNNEL ! # endif ! # define HAVE_ARPHRD_METRICOM ! # define HAVE_ARPHRD_IEEE802 ! # define HAVE_ARPHRD_LOOPBACK ! # define HAVE_SO_BINDTODEVICE ! # define HAVE_SIOCGIFHWADDR ! #endif ! ! #if !defined (USE_LPF) ! # if defined (USE_DEFAULT_NETWORK) # define USE_SOCKETS ! # endif ! # define IGNORE_HOSTUNREACH #endif diff -rNc2 dhcp-2.0b1pl6/includes/cf/nextstep.h dhcp-2.0b1pl18/includes/cf/nextstep.h *** dhcp-2.0b1pl6/includes/cf/nextstep.h Fri Nov 21 23:52:41 1997 --- dhcp-2.0b1pl18/includes/cf/nextstep.h Wed Jul 8 16:25:42 1998 *************** *** 69,75 **** #define IPTOS_RELIABILITY 0x04 #endif ! #define _PATH_DHCPD_PID "/etc/dhcpd.pid" ! #define _PATH_DHCLIENT_PID "/etc/dhclient.pid" ! #define _PATH_DHCLIENT_PID "/etc/dhcrelay.pid" /* Stdarg definitions for ANSI-compliant C compilers. */ #import --- 69,85 ---- #define IPTOS_RELIABILITY 0x04 #endif ! ! #if !defined (_PATH_DHCPD_PID) ! # define _PATH_DHCPD_PID "/etc/dhcpd.pid" ! #endif ! ! #if !defined (_PATH_DHCLIENT_PID) ! # define _PATH_DHCLIENT_PID "/etc/dhclient.pid" ! #endif ! ! #if !defined (_PATH_DHCRELAY_PID) ! # define _PATH_DHCRELAY_PID "/etc/dhcrelay.pid" ! #endif ! /* Stdarg definitions for ANSI-compliant C compilers. */ #import diff -rNc2 dhcp-2.0b1pl6/includes/cf/sunos5-5.h dhcp-2.0b1pl18/includes/cf/sunos5-5.h *** dhcp-2.0b1pl6/includes/cf/sunos5-5.h Fri Jun 26 13:50:41 1998 --- dhcp-2.0b1pl18/includes/cf/sunos5-5.h Tue Feb 23 14:11:05 1999 *************** *** 118,127 **** #define NEED_INET_ATON - /* By default, use BSD Socket API for receiving and sending packets. - This actually works pretty well on Solaris, which doesn't censor - the all-ones broadcast address. */ #if defined (USE_DEFAULT_NETWORK) # define USE_DLPI - # define USE_DLPI_RAW # define USE_DLPI_PFMOD #endif --- 118,123 ---- diff -rNc2 dhcp-2.0b1pl6/includes/cf/ultrix.h dhcp-2.0b1pl18/includes/cf/ultrix.h *** dhcp-2.0b1pl6/includes/cf/ultrix.h Fri Nov 21 23:52:43 1997 --- dhcp-2.0b1pl18/includes/cf/ultrix.h Wed Feb 3 11:46:03 1999 *************** *** 4,8 **** /* ! * Copyright (c) 1996 The Internet Software Consortium. All rights reserved. * * Redistribution and use in source and binary forms, with or without --- 4,9 ---- /* ! * Copyright (c) 1996, 1999 ! * The Internet Software Consortium. All rights reserved. * * Redistribution and use in source and binary forms, with or without *************** *** 70,73 **** --- 71,76 ---- #define u_int16_t unsigned short #define u_int32_t unsigned long + + #define ssize_t size_t /* The jmp_buf type is an array on ultrix, so we can't dereference it diff -rNc2 dhcp-2.0b1pl6/includes/dhcp.h dhcp-2.0b1pl18/includes/dhcp.h *** dhcp-2.0b1pl6/includes/dhcp.h Thu Jan 2 04:00:15 1997 --- dhcp-2.0b1pl18/includes/dhcp.h Tue Dec 22 14:46:17 1998 *************** *** 85,88 **** --- 85,89 ---- #define HTYPE_ETHER 1 /* Ethernet 10Mbps */ #define HTYPE_IEEE802 6 /* IEEE 802.2 Token Ring... */ + #define HTYPE_FDDI 8 /* FDDI... */ /* Magic cookie validating dhcp options field (and bootp vendor diff -rNc2 dhcp-2.0b1pl6/includes/dhcpd.h dhcp-2.0b1pl18/includes/dhcpd.h *** dhcp-2.0b1pl6/includes/dhcpd.h Fri Jun 26 13:51:00 1998 --- dhcp-2.0b1pl18/includes/dhcpd.h Mon Feb 8 20:53:37 1999 *************** *** 4,9 **** /* ! * Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. ! * All rights reserved. * * Redistribution and use in source and binary forms, with or without --- 4,9 ---- /* ! * Copyright (c) 1995, 1996, 1997, 1998, 1999 ! * The Internet Software Consortium. All rights reserved. * * Redistribution and use in source and binary forms, with or without *************** *** 156,160 **** struct tree_cache *options [256]; u_int32_t expiry, renewal, rebind; ! char *filename, *server_name; u_int32_t xid; --- 156,163 ---- struct tree_cache *options [256]; u_int32_t expiry, renewal, rebind; ! char filename [DHCP_FILE_LEN]; ! char *server_name; ! ! struct iaddr from; u_int32_t xid; *************** *** 205,208 **** --- 208,213 ---- int get_lease_hostnames; int use_host_decl_names; + int use_lease_addr_for_default_route; + int authoritative; struct tree_cache *options [256]; *************** *** 480,487 **** extern int log_perror; - #ifdef USE_FALLBACK - extern struct interface_info fallback_interface; - #endif - extern char *path_dhcpd_conf; extern char *path_dhcpd_db; --- 485,488 ---- *************** *** 578,581 **** --- 579,583 ---- extern struct subnet *find_subnet PROTO ((struct iaddr)); void enter_shared_network PROTO ((struct shared_network *)); + int subnet_inner_than PROTO ((struct subnet *, struct subnet *, int)); void enter_subnet PROTO ((struct subnet *)); void enter_lease PROTO ((struct lease *)); *************** *** 651,655 **** struct in_addr, struct sockaddr_in *, struct hardware *)); - void fallback_discard PROTO ((struct protocol *)); #endif --- 653,656 ---- *************** *** 662,665 **** --- 663,669 ---- struct sockaddr_in *, struct hardware *)); #endif + #if defined (USE_SOCKET_FALLBACK) + void fallback_discard PROTO ((struct protocol *)); + #endif #ifdef USE_SOCKET_RECEIVE void if_reinitialize_receive PROTO ((struct interface_info *)); *************** *** 670,674 **** #endif #if defined (USE_SOCKET_SEND) && !defined (USE_SOCKET_FALLBACK) ! void if_enable PROTO ((struct interface_info *)); #endif --- 674,679 ---- #endif #if defined (USE_SOCKET_SEND) && !defined (USE_SOCKET_FALLBACK) ! int can_unicast_without_arp PROTO ((void)); ! void maybe_setup_fallback PROTO ((void)); #endif *************** *** 693,697 **** #endif #if defined (USE_BPF_SEND) ! void if_enable PROTO ((struct interface_info *)); #endif --- 698,727 ---- #endif #if defined (USE_BPF_SEND) ! int can_unicast_without_arp PROTO ((void)); ! void maybe_setup_fallback PROTO ((void)); ! #endif ! ! /* lpf.c */ ! #if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE) ! int if_register_lpf PROTO ( (struct interface_info *)); ! #endif ! #ifdef USE_LPF_SEND ! void if_reinitialize_send PROTO ((struct interface_info *)); ! void if_register_send PROTO ((struct interface_info *)); ! ssize_t send_packet PROTO ((struct interface_info *, ! struct packet *, struct dhcp_packet *, size_t, ! struct in_addr, ! struct sockaddr_in *, struct hardware *)); ! #endif ! #ifdef USE_LPF_RECEIVE ! void if_reinitialize_receive PROTO ((struct interface_info *)); ! void if_register_receive PROTO ((struct interface_info *)); ! ssize_t receive_packet PROTO ((struct interface_info *, ! unsigned char *, size_t, ! struct sockaddr_in *, struct hardware *)); ! #endif ! #if defined (USE_LPF_SEND) ! int can_unicast_without_arp PROTO ((void)); ! void maybe_setup_fallback PROTO ((void)); #endif *************** *** 716,721 **** struct sockaddr_in *, struct hardware *)); #endif ! #if defined (USE_BPF_SEND) ! void if_enable PROTO ((struct interface_info *)); #endif --- 746,772 ---- struct sockaddr_in *, struct hardware *)); #endif ! #if defined (USE_NIT_SEND) ! int can_unicast_without_arp PROTO ((void)); ! void maybe_setup_fallback PROTO ((void)); ! #endif ! ! #ifdef USE_DLPI_SEND ! void if_reinitialize_send PROTO ((struct interface_info *)); ! void if_register_send PROTO ((struct interface_info *)); ! ssize_t send_packet PROTO ((struct interface_info *, ! struct packet *, struct dhcp_packet *, size_t, ! struct in_addr, ! struct sockaddr_in *, struct hardware *)); ! #endif ! #ifdef USE_DLPI_RECEIVE ! void if_reinitialize_receive PROTO ((struct interface_info *)); ! void if_register_receive PROTO ((struct interface_info *)); ! ssize_t receive_packet PROTO ((struct interface_info *, ! unsigned char *, size_t, ! struct sockaddr_in *, struct hardware *)); ! #endif ! #if defined (USE_DLPI_SEND) ! int can_unicast_without_arp PROTO ((void)); ! void maybe_setup_fallback PROTO ((void)); #endif *************** *** 728,735 **** struct in_addr, struct sockaddr_in *, struct hardware *)); #endif /* dispatch.c */ ! extern struct interface_info *interfaces, *dummy_interfaces; extern struct protocol *protocols; extern int quiet_interface_discovery; --- 779,789 ---- struct in_addr, struct sockaddr_in *, struct hardware *)); + int can_unicast_without_arp PROTO ((void)); + void maybe_setup_fallback PROTO ((void)); #endif /* dispatch.c */ ! extern struct interface_info *interfaces, ! *dummy_interfaces, *fallback_interface; extern struct protocol *protocols; extern int quiet_interface_discovery; *************** *** 740,750 **** extern struct timeout *timeouts; void discover_interfaces PROTO ((int)); void reinitialize_interfaces PROTO ((void)); void dispatch PROTO ((void)); int locate_network PROTO ((struct packet *)); void add_timeout PROTO ((TIME, void (*) PROTO ((void *)), void *)); - #if 0 - void add_fast_timeout PROTO ((UTIME, void (*) PROTO ((void *)), void *)); - #endif void cancel_timeout PROTO ((void (*) PROTO ((void *)), void *)); void add_protocol PROTO ((char *, int, --- 794,803 ---- extern struct timeout *timeouts; void discover_interfaces PROTO ((int)); + struct interface_info *setup_fallback PROTO ((void)); void reinitialize_interfaces PROTO ((void)); void dispatch PROTO ((void)); int locate_network PROTO ((struct packet *)); + void got_one PROTO ((struct protocol *)); void add_timeout PROTO ((TIME, void (*) PROTO ((void *)), void *)); void cancel_timeout PROTO ((void (*) PROTO ((void *)), void *)); void add_protocol PROTO ((char *, int, *************** *** 821,825 **** void rewrite_client_leases PROTO ((void)); void write_client_lease PROTO ((struct interface_info *, ! struct client_lease *)); char *dhcp_option_ev_name PROTO ((struct option *)); --- 874,878 ---- void rewrite_client_leases PROTO ((void)); void write_client_lease PROTO ((struct interface_info *, ! struct client_lease *, int)); char *dhcp_option_ev_name PROTO ((struct option *)); diff -rNc2 dhcp-2.0b1pl6/includes/dhctoken.h dhcp-2.0b1pl18/includes/dhctoken.h *** dhcp-2.0b1pl6/includes/dhctoken.h Mon Jun 2 16:24:05 1997 --- dhcp-2.0b1pl18/includes/dhctoken.h Mon Feb 8 20:51:45 1999 *************** *** 4,9 **** /* ! * Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. ! * All rights reserved. * * Redistribution and use in source and binary forms, with or without --- 4,9 ---- /* ! * Copyright (c) 1995, 1996, 1997, 1998, 1999 ! * The Internet Software Consortium. All rights reserved. * * Redistribution and use in source and binary forms, with or without *************** *** 125,128 **** --- 125,132 ---- #define CLIENT_HOSTNAME 329 #define REJECT 330 + #define FDDI 331 + #define USE_LEASE_ADDR_FOR_DEFAULT_ROUTE 332 + #define AUTHORITATIVE 333 + #define TOKEN_NOT 334 #define is_identifier(x) ((x) >= FIRST_TOKEN && \ diff -rNc2 dhcp-2.0b1pl6/includes/osdep.h dhcp-2.0b1pl18/includes/osdep.h *** dhcp-2.0b1pl6/includes/osdep.h Thu Jun 25 11:34:47 1998 --- dhcp-2.0b1pl18/includes/osdep.h Sat Feb 27 13:42:25 1999 *************** *** 4,8 **** /* ! * Copyright (c) 1996, 1997, 1998 The Internet Software Consortium. * All rights reserved. * --- 4,8 ---- /* ! * Copyright (c) 1996, 1997, 1998, 1999 The Internet Software Consortium. * All rights reserved. * *************** *** 52,55 **** --- 52,58 ---- !defined (USE_BPF_SEND) && \ !defined (USE_BPF_RECEIVE) && \ + !defined (USE_LPF) && \ + !defined (USE_LPF_SEND) && \ + !defined (USE_LPF_RECEIVE) && \ !defined (USE_NIT) && \ !defined (USE_NIT_SEND) && \ *************** *** 121,124 **** --- 124,131 ---- #endif + #if !defined (TIME_MAX) + # define TIME_MAX 2147483647 + #endif + /* Porting:: *************** *** 142,145 **** --- 149,157 ---- #endif + #ifdef USE_LPF + # define USE_LPF_SEND + # define USE_LPF_RECEIVE + #endif + #ifdef USE_NIT # define USE_NIT_SEND *************** *** 166,170 **** #if defined (USE_BPF_SEND) || defined (USE_NIT_SEND) || \ ! defined (USE_DLPI_SEND) || defined (USE_UPF_SEND) # define USE_SOCKET_FALLBACK # define USE_FALLBACK --- 178,182 ---- #if defined (USE_BPF_SEND) || defined (USE_NIT_SEND) || \ ! defined (USE_DLPI_SEND) || defined (USE_UPF_SEND) || defined (USE_LPF_SEND) # define USE_SOCKET_FALLBACK # define USE_FALLBACK *************** *** 179,183 **** #if defined (USE_RAW_SEND) || defined (USE_BPF_SEND) || \ defined (USE_NIT_SEND) || defined (USE_UPF_SEND) || \ ! defined (USE_DLPI_SEND) # define PACKET_ASSEMBLY #endif --- 191,195 ---- #if defined (USE_RAW_SEND) || defined (USE_BPF_SEND) || \ defined (USE_NIT_SEND) || defined (USE_UPF_SEND) || \ ! defined (USE_DLPI_SEND) || defined (USE_LPF_SEND) # define PACKET_ASSEMBLY #endif *************** *** 191,195 **** #if defined (USE_RAW_RECEIVE) || defined (USE_BPF_SEND) || \ defined (USE_NIT_RECEIVE) || defined (USE_UPF_RECEIVE) || \ ! defined (USE_DLPI_RECEIVE) # define PACKET_DECODING #endif --- 203,207 ---- #if defined (USE_RAW_RECEIVE) || defined (USE_BPF_SEND) || \ defined (USE_NIT_RECEIVE) || defined (USE_UPF_RECEIVE) || \ ! defined (USE_DLPI_RECEIVE) || defined (USE_LPF_RECEIVE) # define PACKET_DECODING #endif *************** *** 219,220 **** --- 231,265 ---- # define BPF_FORMAT "/dev/bpf%d" #endif + + #if defined (IFF_POINTOPOINT) && !defined (HAVE_IFF_POINTOPOINT) + # define HAVE_IFF_POINTOPOINT + #endif + + #if defined (AF_LINK) && !defined (HAVE_AF_LINK) + # define HAVE_AF_LINK + #endif + + #if defined (ARPHRD_TUNNEL) && !defined (HAVE_ARPHRD_TUNNEL) + # define HAVE_ARPHRD_TUNNEL + #endif + + #if defined (ARPHRD_LOOPBACK) && !defined (HAVE_ARPHRD_LOOPBACK) + # define HAVE_ARPHRD_LOOPBACK + #endif + + #if defined (ARPHRD_METRICOM) && !defined (HAVE_ARPHRD_METRICOM) + # define HAVE_ARPHRD_METRICOM + #endif + + #if defined (SO_BINDTODEVICE) && !defined (HAVE_SO_BINDTODEVICE) + # define HAVE_SO_BINDTODEVICE + #endif + + #if defined (SIOCGIFHWADDR) && !defined (HAVE_SIOCGIFHWADDR) + # define HAVE_SIOCGIFHWADDR + #endif + + #if defined (AF_LINK) && !defined (HAVE_AF_LINK) + # define HAVE_AF_LINK + #endif + diff -rNc2 dhcp-2.0b1pl6/relay/Makefile.dist dhcp-2.0b1pl18/relay/Makefile.dist *** dhcp-2.0b1pl6/relay/Makefile.dist Fri Mar 28 19:31:08 1997 --- dhcp-2.0b1pl18/relay/Makefile.dist Tue Feb 23 10:09:36 1999 *************** *** 44,63 **** all: $(PROG) $(CATMANPAGES) ! install: $(PROG) $(CATMANPAGES) ! $(INSTALL) dhcrelay $(BINDIR); $(CHMOD) 755 $(BINDIR)/dhcrelay ! if [ ! -d $(ADMMANDIR) ]; then \ ! mkdir $(ADMMANDIR); \ ! chmod 755 $(ADMMANDIR); \ ! fi ! if [ ! -d $(FFMANDIR) ]; then \ ! mkdir $(FFMANDIR); \ ! chmod 755 $(FFMANDIR); \ ! fi ! if [ ! -d $(VARDB) ]; then \ ! mkdir $(VARDB); \ ! chmod 755 $(VARDB); \ ! fi $(MANINSTALL) $(MANFROM) dhcrelay.cat8 $(MANTO) \ ! $(ADMMANDIR)/dhcrelay$(ADMMANEXT) clean: --- 44,62 ---- all: $(PROG) $(CATMANPAGES) ! install: all ! for dir in $(BINDIR) $(ADMMANDIR); do \ ! foo=""; \ ! for bar in `echo $(DESTDIR)$${dir} |tr / ' '`; do \ ! foo=$${foo}/$$bar; \ ! if [ ! -d $$foo ]; then \ ! mkdir $$foo; \ ! chmod 755 $$foo; \ ! fi; \ ! done; \ ! done ! $(INSTALL) dhcrelay $(DESTDIR)$(BINDIR) ! $(CHMOD) 755 $(DESTDIR)$(BINDIR)/dhcrelay $(MANINSTALL) $(MANFROM) dhcrelay.cat8 $(MANTO) \ ! $(DESTDIR)$(ADMMANDIR)/dhcrelay$(ADMMANEXT) clean: diff -rNc2 dhcp-2.0b1pl6/relay/dhcrelay.8 dhcp-2.0b1pl18/relay/dhcrelay.8 *** dhcp-2.0b1pl6/relay/dhcrelay.8 Fri Nov 21 23:58:22 1997 --- dhcp-2.0b1pl18/relay/dhcrelay.8 Fri Mar 5 08:05:27 1999 *************** *** 103,106 **** --- 103,117 ---- flag may used. It should be followed by the udp port number that dhcrelay should use. This is mostly useful for debugging purposes. + If the + .B -p + flag is specified, the relay agent will transmit responses to clients + at a port number that is one greater than the one specified - i.e., if + you specify + .B -p + 67, then the relay agent will listen on port 67 and transmit to port + 68. Transmissions to servers will be sent to the same port number + that it specified in the + .B -p + flag. .PP Dhcrelay will normally run in the foreground until it has configured diff -rNc2 dhcp-2.0b1pl6/relay/dhcrelay.c dhcp-2.0b1pl18/relay/dhcrelay.c *** dhcp-2.0b1pl6/relay/dhcrelay.c Thu Jun 25 14:11:34 1998 --- dhcp-2.0b1pl18/relay/dhcrelay.c Fri Mar 5 08:13:56 1999 *************** *** 4,8 **** /* ! * Copyright (c) 1997 The Internet Software Consortium. * All rights reserved. * --- 4,8 ---- /* ! * Copyright (c) 1997, 1998, 1999 The Internet Software Consortium. * All rights reserved. * *************** *** 42,47 **** #ifndef lint ! static char copyright[] = ! "$Id: dhcrelay.c,v 1.9.2.4 1998/06/25 21:11:34 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 42,47 ---- #ifndef lint ! static char ocopyright [] = ! "$Id: dhcrelay.c,v 1.9.2.21 1999/03/05 16:13:56 mellon Exp $ Copyright (c) 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 65,72 **** char *path_dhcrelay_pid = _PATH_DHCRELAY_PID; - #ifdef USE_FALLBACK - struct interface_info fallback_interface; - #endif - u_int16_t local_port; u_int16_t remote_port; --- 65,68 ---- *************** *** 78,81 **** --- 74,84 ---- } *servers; + static char copyright [] = + "Copyright 1997, 1998, 1999 The Internet Software Consortium."; + static char arr [] = "All rights reserved."; + static char message [] = "Internet Software Consortium DHCP Relay Agent V2.0b1pl18"; + static char contrib [] = "\nPlease contribute if you find this software useful."; + static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html\n"; + int main (argc, argv, envp) int argc; *************** *** 154,157 **** --- 157,168 ---- } + if (!quiet) { + note (message); + note (copyright); + note (arr); + note (contrib); + note (url); + } + /* Default to the DHCP/BOOTP port. */ if (!local_port) { *************** *** 250,260 **** /* If it's a bootreply, forward it to the client. */ if (packet -> op == BOOTREPLY) { ! #ifndef USE_FALLBACK ! if (!(packet -> flags & htons (BOOTP_BROADCAST))) { to.sin_addr = packet -> yiaddr; to.sin_port = remote_port; ! } else ! #endif ! { to.sin_addr.s_addr = htonl (INADDR_BROADCAST); to.sin_port = remote_port; --- 261,269 ---- /* If it's a bootreply, forward it to the client. */ if (packet -> op == BOOTREPLY) { ! if (!(packet -> flags & htons (BOOTP_BROADCAST)) && ! can_unicast_without_arp ()) { to.sin_addr = packet -> yiaddr; to.sin_port = remote_port; ! } else { to.sin_addr.s_addr = htonl (INADDR_BROADCAST); to.sin_port = remote_port; *************** *** 265,272 **** #endif ! memcpy (hto.haddr, packet -> chaddr, ! (packet -> hlen > sizeof hto.haddr ! ? sizeof hto.haddr ! : packet -> hlen)); hto.htype = packet -> htype; --- 274,282 ---- #endif ! /* Set up the hardware destination address. */ ! hto.hlen = packet -> hlen; ! if (hto.hlen > sizeof hto.haddr) ! hto.hlen = sizeof hto.haddr; ! memcpy (hto.haddr, packet -> chaddr, hto.hlen); hto.htype = packet -> htype; *************** *** 285,294 **** } ! if (send_packet (out, ! (struct packet *)0, ! packet, length, out -> primary_address, ! &to, &hto) < 0) ! debug ("sendpkt: %m"); ! else debug ("forwarded BOOTREPLY for %s to %s", print_hw_addr (packet -> htype, packet -> hlen, --- 295,302 ---- } ! if (!send_packet (out, ! (struct packet *)0, ! packet, length, out -> primary_address, ! &to, &hto) < 0) debug ("forwarded BOOTREPLY for %s to %s", print_hw_addr (packet -> htype, packet -> hlen, *************** *** 315,333 **** servers. */ for (sp = servers; sp; sp = sp -> next) { ! if ( ! #ifdef USE_FALLBACK ! send_fallback (&fallback_interface, ! (struct packet *)0, ! packet, length, ip -> primary_address, ! &sp -> to, (struct hardware *)0) ! #else ! send_packet (interfaces, ! (struct packet *)0, ! packet, length, ip -> primary_address, ! &sp -> to, (struct hardware *)0) ! #endif ! < 0) { ! debug ("send_packet: %m"); ! } else { debug ("forwarded BOOTREQUEST for %s to %s", print_hw_addr (packet -> htype, packet -> hlen, --- 323,331 ---- servers. */ for (sp = servers; sp; sp = sp -> next) { ! if (!send_packet ((fallback_interface ! ? fallback_interface : interfaces), ! (struct packet *)0, ! packet, length, ip -> primary_address, ! &sp -> to, (struct hardware *)0) < 0) { debug ("forwarded BOOTREQUEST for %s to %s", print_hw_addr (packet -> htype, packet -> hlen, *************** *** 341,345 **** static void usage () { ! error ("Usage: dhcrelay [-c] [-p ] [server1 [... serverN]]"); } --- 339,344 ---- static void usage () { ! warn ("Usage: dhcrelay [-i] [-d] [-i if0] [...-i ifN] [-p ]"); ! error (" [server1 [... serverN]]"); } diff -rNc2 dhcp-2.0b1pl6/server/Makefile.dist dhcp-2.0b1pl18/server/Makefile.dist *** dhcp-2.0b1pl6/server/Makefile.dist Fri Nov 21 23:14:58 1997 --- dhcp-2.0b1pl18/server/Makefile.dist Tue Feb 23 10:09:36 1999 *************** *** 1,5 **** # Makefile.dist # ! # Copyright (c) 1996, 1997 The Internet Software Consortium. # All rights reserved. # --- 1,5 ---- # Makefile.dist # ! # Copyright (c) 1996, 1997, 1999 The Internet Software Consortium. # All rights reserved. # *************** *** 44,67 **** all: $(PROG) $(CATMANPAGES) ! install: $(PROG) $(CATMANPAGES) ! $(INSTALL) dhcpd $(BINDIR); $(CHMOD) 755 $(BINDIR)/dhcpd ! if [ ! -d $(ADMMANDIR) ]; then \ ! mkdir $(ADMMANDIR); \ ! chmod 755 $(ADMMANDIR); \ ! fi ! if [ ! -d $(FFMANDIR) ]; then \ ! mkdir $(FFMANDIR); \ ! chmod 755 $(FFMANDIR); \ ! fi ! if [ ! -d $(VARDB) ]; then \ ! mkdir $(VARDB); \ ! chmod 755 $(VARDB); \ ! fi $(MANINSTALL) $(MANFROM) dhcpd.cat8 $(MANTO) \ ! $(ADMMANDIR)/dhcpd$(ADMMANEXT) $(MANINSTALL) $(MANFROM) dhcpd.conf.cat5 $(MANTO) \ ! $(FFMANDIR)/dhcpd.conf$(FFMANEXT) $(MANINSTALL) $(MANFROM) dhcpd.leases.cat5 $(MANTO) \ ! $(FFMANDIR)/dhcpd.leases$(FFMANEXT) clean: --- 44,66 ---- all: $(PROG) $(CATMANPAGES) ! install: all ! for dir in $(BINDIR) $(ADMMANDIR) $(FFMANDIR) $(VARDB); do \ ! foo=""; \ ! for bar in `echo $(DESTDIR)$${dir} |tr / ' '`; do \ ! foo=$${foo}/$$bar; \ ! if [ ! -d $$foo ]; then \ ! mkdir $$foo; \ ! chmod 755 $$foo; \ ! fi; \ ! done; \ ! done ! $(INSTALL) dhcpd $(DESTDIR)$(BINDIR) ! $(CHMOD) 755 $(DESTDIR)$(BINDIR)/dhcpd $(MANINSTALL) $(MANFROM) dhcpd.cat8 $(MANTO) \ ! $(DESTDIR)$(ADMMANDIR)/dhcpd$(ADMMANEXT) $(MANINSTALL) $(MANFROM) dhcpd.conf.cat5 $(MANTO) \ ! $(DESTDIR)$(FFMANDIR)/dhcpd.conf$(FFMANEXT) $(MANINSTALL) $(MANFROM) dhcpd.leases.cat5 $(MANTO) \ ! $(DESTDIR)$(FFMANDIR)/dhcpd.leases$(FFMANEXT) clean: diff -rNc2 dhcp-2.0b1pl6/server/bootp.c dhcp-2.0b1pl18/server/bootp.c *** dhcp-2.0b1pl6/server/bootp.c Tue Sep 16 11:17:55 1997 --- dhcp-2.0b1pl18/server/bootp.c Tue Feb 23 09:43:38 1999 *************** *** 4,8 **** /* ! * Copyright (c) 1995, 1996 The Internet Software Consortium. * All rights reserved. * --- 4,8 ---- /* ! * Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. * All rights reserved. * *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: bootp.c,v 1.28 1997/09/16 18:17:55 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: bootp.c,v 1.28.2.3 1999/02/23 17:43:38 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 111,115 **** if (host && (!host -> group -> allow_booting)) { note ("Ignoring excluded BOOTP client %s", ! host -> name); return; } --- 111,119 ---- if (host && (!host -> group -> allow_booting)) { note ("Ignoring excluded BOOTP client %s", ! host -> name ! ? host -> name ! : print_hw_addr (packet -> raw -> htype, ! packet -> raw -> hlen, ! packet -> raw -> chaddr)); return; } *************** *** 117,121 **** if (host && (!host -> group -> allow_bootp)) { note ("Ignoring BOOTP request from client %s", ! host -> name); return; } --- 121,129 ---- if (host && (!host -> group -> allow_bootp)) { note ("Ignoring BOOTP request from client %s", ! host -> name ! ? host -> name ! : print_hw_addr (packet -> raw -> htype, ! packet -> raw -> hlen, ! packet -> raw -> chaddr)); return; } *************** *** 223,244 **** outgoing.raw = &raw; ! /* Come up with a list of options that we want to send to this ! client. Start with the per-subnet options, and then override ! those with client-specific options. */ ! ! memcpy (options, subnet -> group -> options, sizeof options); ! ! for (i = 0; i < 256; i++) { ! if (hp -> group -> options [i]) ! options [i] = hp -> group -> options [i]; ! } ! ! /* Pack the options into the buffer. Unlike DHCP, we can't ! pack options into the filename and server name buffers. */ ! ! outgoing.packet_length = ! cons_options (packet, outgoing.raw, options, 0, 0, 1); ! if (outgoing.packet_length < BOOTP_MIN_LEN) outgoing.packet_length = BOOTP_MIN_LEN; /* Take the fields that we care about... */ --- 231,262 ---- outgoing.raw = &raw; ! /* If we didn't get a known vendor magic number on the way in, ! just copy the input options to the output. */ ! if (!packet -> options_valid) { ! memcpy (outgoing.raw -> options, ! packet -> raw -> options, DHCP_OPTION_LEN); outgoing.packet_length = BOOTP_MIN_LEN; + } else { + /* Come up with a list of options that we want to send + to this client. Start with the per-subnet options, + and then override those with client-specific + options. */ + + memcpy (options, subnet -> group -> options, sizeof options); + + for (i = 0; i < 256; i++) { + if (hp -> group -> options [i]) + options [i] = hp -> group -> options [i]; + } + + /* Pack the options into the buffer. Unlike DHCP, we + can't pack options into the filename and server + name buffers. */ + + outgoing.packet_length = + cons_options (packet, outgoing.raw, options, 0, 0, 1); + if (outgoing.packet_length < BOOTP_MIN_LEN) + outgoing.packet_length = BOOTP_MIN_LEN; + } /* Take the fields that we care about... */ *************** *** 246,252 **** raw.htype = packet -> raw -> htype; raw.hlen = packet -> raw -> hlen; ! memcpy (raw.chaddr, packet -> raw -> chaddr, raw.hlen); ! memset (&raw.chaddr [raw.hlen], 0, ! (sizeof raw.chaddr) - raw.hlen); raw.hops = packet -> raw -> hops; raw.xid = packet -> raw -> xid; --- 264,268 ---- raw.htype = packet -> raw -> htype; raw.hlen = packet -> raw -> hlen; ! memcpy (raw.chaddr, packet -> raw -> chaddr, sizeof raw.chaddr); raw.hops = packet -> raw -> hops; raw.xid = packet -> raw -> xid; *************** *** 276,280 **** (sizeof raw.file) - 1); raw.file [(sizeof raw.file) - 1] = 0; ! } /* Set up the hardware destination address... */ --- 292,297 ---- (sizeof raw.file) - 1); raw.file [(sizeof raw.file) - 1] = 0; ! } else ! memcpy (raw.file, packet -> raw -> file, sizeof raw.file); /* Set up the hardware destination address... */ *************** *** 307,319 **** to.sin_port = local_port; ! #ifdef USE_FALLBACK ! result = send_fallback (&fallback_interface, ! (struct packet *)0, ! &raw, outgoing.packet_length, ! from, &to, &hto); ! if (result < 0) ! warn ("send_fallback: %m"); ! return; ! #endif /* Otherwise, broadcast it on the local network. */ } else { --- 324,334 ---- to.sin_port = local_port; ! if (fallback_interface) { ! result = send_packet (fallback_interface, ! (struct packet *)0, ! &raw, outgoing.packet_length, ! from, &to, &hto); ! return; ! } /* Otherwise, broadcast it on the local network. */ } else { *************** *** 326,330 **** packet, &raw, outgoing.packet_length, from, &to, &hto); - if (result < 0) - warn ("send_packet: %m"); } --- 341,343 ---- diff -rNc2 dhcp-2.0b1pl6/server/confpars.c dhcp-2.0b1pl18/server/confpars.c *** dhcp-2.0b1pl6/server/confpars.c Thu Jun 25 15:12:59 1998 --- dhcp-2.0b1pl18/server/confpars.c Tue Feb 16 10:57:33 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: confpars.c,v 1.45.2.2 1998/06/25 22:12:59 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: confpars.c,v 1.45.2.7 1999/02/16 18:57:33 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 74,77 **** --- 74,78 ---- root_group.allow_bootp = 1; root_group.allow_booting = 1; + root_group.authoritative = 1; if ((cfile = fopen (path_dhcpd_conf, "r")) == NULL) *************** *** 156,159 **** --- 157,161 ---- | ALLOW allow-deny-keyword | DENY allow-deny-keyword + | USE_LEASE_ADDR_FOR_DEFAULT_ROUTE boolean declaration :== host-declaration *************** *** 240,247 **** --- 242,252 ---- parse_subnet_declaration (cfile, share); + + /* share -> subnets is the subnet we just parsed. */ if (share -> subnets) { share -> interface = share -> subnets -> interface; + /* Make the shared network name from network number. */ n = piaddr (share -> subnets -> net); t = malloc (strlen (n) + 1); *************** *** 250,253 **** --- 255,263 ---- strcpy (t, n); share -> name = t; + + /* Copy the authoritative parameter from the subnet, + since there is no opportunity to declare it here. */ + share -> group -> authoritative = + share -> subnets -> group -> authoritative; enter_shared_network (share); } *************** *** 302,305 **** --- 312,343 ---- break; + case USE_LEASE_ADDR_FOR_DEFAULT_ROUTE: + group -> use_lease_addr_for_default_route = + parse_boolean (cfile); + break; + + case TOKEN_NOT: + token = next_token (&val, cfile); + switch (token) { + case AUTHORITATIVE: + if (type == HOST_DECL) + parse_warn ("authority makes no sense here."); + group -> authoritative = 0; + parse_semi (cfile); + break; + default: + parse_warn ("expecting assertion"); + skip_to_semi (cfile); + break; + } + break; + + case AUTHORITATIVE: + if (type == HOST_DECL) + parse_warn ("authority makes no sense here."); + group -> authoritative = 1; + parse_semi (cfile); + break; + case NEXT_SERVER: tree = parse_ip_addr_or_hostname (cfile, 0); *************** *** 323,331 **** if (!tree) return declaration; ! cache = tree_cache (tree); ! if (type == ROOT_GROUP) { ! if (!tree_evaluate (cache)) ! error ("server-identifier is not known"); ! } token = next_token (&val, cfile); break; --- 361,366 ---- if (!tree) return declaration; ! group -> options [DHO_DHCP_SERVER_IDENTIFIER] = ! tree_cache (tree); token = next_token (&val, cfile); break; *************** *** 662,666 **** char *val; int token; ! struct subnet *subnet, *t; struct iaddr iaddr; unsigned char addr [4]; --- 697,701 ---- char *val; int token; ! struct subnet *subnet, *t, *u; struct iaddr iaddr; unsigned char addr [4]; *************** *** 729,735 **** share -> subnets = subnet; else { for (t = share -> subnets; ! t -> next_sibling; t = t -> next_sibling) ! ; t -> next_sibling = subnet; } --- 764,780 ---- share -> subnets = subnet; else { + u = (struct subnet *)0; for (t = share -> subnets; ! t -> next_sibling; t = t -> next_sibling) { ! if (subnet_inner_than (subnet, t, 0)) { ! if (u) ! u -> next_sibling = subnet; ! else ! share -> subnets = subnet; ! subnet -> next_sibling = t; ! return; ! } ! u = t; ! } t -> next_sibling = subnet; } diff -rNc2 dhcp-2.0b1pl6/server/db.c dhcp-2.0b1pl18/server/db.c *** dhcp-2.0b1pl6/server/db.c Mon Dec 1 23:44:56 1997 --- dhcp-2.0b1pl18/server/db.c Wed Aug 5 12:33:16 1998 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: db.c,v 1.17 1997/12/02 07:44:56 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: db.c,v 1.17.2.1 1998/08/05 19:33:16 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 62,65 **** --- 62,66 ---- char tbuf [64]; int errors = 0; + int i; if (counting) *************** *** 135,138 **** --- 136,143 ---- } if (lease -> client_hostname) { + for (i = 0; lease -> client_hostname [i]; i++) + if (lease -> client_hostname [i] < 33 || + lease -> client_hostname [i] > 126) + goto bad_client_hostname; errno = 0; fprintf (db_file, "\n\tclient-hostname \"%s\";", *************** *** 142,146 **** --- 147,157 ---- } } + bad_client_hostname: if (lease -> hostname) { + for (i = 0; lease -> hostname [i]; i++) + if (lease -> hostname [i] < 33 || + lease -> hostname [i] > 126) + goto bad_hostname; + errno = 0; errno = 0; fprintf (db_file, "\n\thostname \"%s\";", *************** *** 150,153 **** --- 161,165 ---- } } + bad_hostname: errno = 0; fputs ("\n}\n", db_file); diff -rNc2 dhcp-2.0b1pl6/server/dhcp.c dhcp-2.0b1pl18/server/dhcp.c *** dhcp-2.0b1pl6/server/dhcp.c Thu Jun 25 21:17:12 1998 --- dhcp-2.0b1pl18/server/dhcp.c Fri Mar 5 08:10:56 1999 *************** *** 4,9 **** /* ! * Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. ! * All rights reserved. * * Redistribution and use in source and binary forms, with or without --- 4,9 ---- /* ! * Copyright (c) 1995, 1996, 1997, 1998, 1999 ! * The Internet Software Consortium. All rights reserved. * * Redistribution and use in source and binary forms, with or without *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: dhcp.c,v 1.57.2.5 1998/06/26 04:17:12 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: dhcp.c,v 1.57.2.21 1999/03/05 16:10:56 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 121,127 **** the administrator will eventually investigate. */ if (lease -> flags & ABANDONED_LEASE) { ! warn ("Reclaiming abandoned IP address %s.", ! piaddr (lease -> ip_addr)); ! lease -> flags &= ~ABANDONED_LEASE; } --- 121,143 ---- the administrator will eventually investigate. */ if (lease -> flags & ABANDONED_LEASE) { ! struct lease *lp; ! ! /* See if we can find an unabandoned lease first. */ ! for (lp = lease; lp; lp = lp -> prev) { ! if (lp -> ends > cur_time) ! break; ! if (!lp -> flags & ABANDONED_LEASE) { ! lease = lp; ! break; ! } ! } ! ! /* If we can't find an unabandoned lease, reclaim the ! abandoned lease. */ ! if (lease -> flags & ABANDONED_LEASE) { ! warn ("Reclaiming abandoned IP address %s.", ! piaddr (lease -> ip_addr)); ! lease -> flags &= ~ABANDONED_LEASE; ! } } *************** *** 163,167 **** !lease -> host -> group -> allow_booting) { note ("Declining to boot client %s", ! lease -> host -> name); } else ack_lease (packet, lease, DHCPOFFER, cur_time + 120); --- 179,187 ---- !lease -> host -> group -> allow_booting) { note ("Declining to boot client %s", ! lease -> host -> name ! ? lease -> host -> name ! : print_hw_addr (packet -> raw -> htype, ! packet -> raw -> hlen, ! packet -> raw -> chaddr)); } else ack_lease (packet, lease, DHCPOFFER, cur_time + 120); *************** *** 255,259 **** from there. Fry it. */ if (!packet -> shared_network) { ! if (subnet) { nak_lease (packet, &cip); return; --- 275,281 ---- from there. Fry it. */ if (!packet -> shared_network) { ! if (subnet && ! subnet -> shared_network -> group -> authoritative) ! { nak_lease (packet, &cip); return; *************** *** 267,271 **** subnet = find_grouped_subnet (packet -> shared_network, cip); if (!subnet) { ! nak_lease (packet, &cip); return; } --- 289,294 ---- subnet = find_grouped_subnet (packet -> shared_network, cip); if (!subnet) { ! if (packet -> shared_network -> group -> authoritative) ! nak_lease (packet, &cip); return; } *************** *** 278,282 **** /* If we found the address the client asked for, but it wasn't what got picked, the lease belongs to us, ! so we can tenuously justify NAKing it. */ if (ours) nak_lease (packet, &cip); --- 301,305 ---- /* If we found the address the client asked for, but it wasn't what got picked, the lease belongs to us, ! so we should NAK it. */ if (ours) nak_lease (packet, &cip); *************** *** 498,509 **** to.sin_port = local_port; ! #ifdef USE_FALLBACK ! result = send_fallback (&fallback_interface, ! packet, &raw, outgoing.packet_length, ! from, &to, &hto); ! if (result < 0) ! warn ("send_fallback: %m"); ! return; ! #endif } else { to.sin_addr.s_addr = htonl (INADDR_BROADCAST); --- 521,533 ---- to.sin_port = local_port; ! if (fallback_interface) { ! result = send_packet (fallback_interface, ! packet, &raw, ! outgoing.packet_length, ! from, &to, &hto); ! if (result < 0) ! warn ("send_fallback: %m"); ! return; ! } } else { to.sin_addr.s_addr = htonl (INADDR_BROADCAST); *************** *** 515,520 **** packet, &raw, outgoing.packet_length, from, &to, (struct hardware *)0); - if (result < 0) - warn ("send_packet: %m"); } --- 539,542 ---- *************** *** 529,532 **** --- 551,557 ---- TIME lease_time; TIME offered_lease_time; + TIME max_lease_time; + TIME default_lease_time; + int ulafdr; struct class *vendor_class, *user_class; *************** *** 612,621 **** the user class, then from the vendor class. */ if (lease -> host && lease -> host -> group -> filename) ! state -> filename = lease -> host -> group -> filename; else if (user_class && user_class -> group -> filename) ! state -> filename = user_class -> group -> filename; else if (vendor_class && vendor_class -> group -> filename) ! state -> filename = vendor_class -> group -> filename; ! else state -> filename = (char *)0; /* Choose a server name as above. */ --- 637,657 ---- the user class, then from the vendor class. */ if (lease -> host && lease -> host -> group -> filename) ! strncpy (state -> filename, lease -> host -> group -> filename, ! sizeof state -> filename); else if (user_class && user_class -> group -> filename) ! strncpy (state -> filename, user_class -> group -> filename, ! sizeof state -> filename); else if (vendor_class && vendor_class -> group -> filename) ! strncpy (state -> filename, vendor_class -> group -> filename, ! sizeof state -> filename); ! else if (packet -> raw -> file [0]) ! strncpy (state -> filename, packet -> raw -> file, ! sizeof state -> filename); ! else if (lease -> subnet -> group -> filename) ! strncpy (state -> filename, ! lease -> subnet -> group -> filename, ! sizeof state -> filename); ! else ! strcpy (state -> filename, ""); /* Choose a server name as above. */ *************** *** 626,629 **** --- 662,668 ---- else if (vendor_class && vendor_class -> group -> server_name) state -> server_name = vendor_class -> group -> server_name; + else if (lease -> subnet -> group -> server_name) + state -> server_name = + lease -> subnet -> group -> server_name; else state -> server_name = (char *)0; *************** *** 641,644 **** --- 680,699 ---- lt.starts = cur_time; + /* Figure out maximum lease time. */ + if (lease -> host && + lease -> host -> group -> max_lease_time) + max_lease_time = lease -> host -> group -> max_lease_time; + else + max_lease_time = lease -> subnet -> group -> max_lease_time; + + /* Figure out default lease time. */ + if (lease -> host + && lease -> host -> group -> default_lease_time) + default_lease_time = + lease -> host -> group -> default_lease_time; + else + default_lease_time = + lease -> subnet -> group -> default_lease_time; + /* Figure out how long a lease to assign. If this is a dynamic BOOTP lease, its duration must be infinite. */ *************** *** 650,674 **** /* Don't let the client ask for a longer lease than is supported for this subnet or host. */ ! if (lease -> host && ! lease -> host -> group -> max_lease_time) { ! if (lease_time > ! lease -> host -> group -> max_lease_time) ! lease_time = (lease -> host -> ! group -> max_lease_time); ! } else { ! if (lease_time > ! lease -> subnet -> group -> max_lease_time) ! lease_time = (lease -> subnet -> ! group -> max_lease_time); ! } ! } else { ! if (lease -> host ! && lease -> host -> group -> default_lease_time) ! lease_time = (lease -> host -> ! group -> default_lease_time); ! else ! lease_time = (lease -> subnet -> ! group -> default_lease_time); ! } state -> offered_expiry = cur_time + lease_time; --- 705,712 ---- /* Don't let the client ask for a longer lease than is supported for this subnet or host. */ ! if (lease_time > max_lease_time) ! lease_time = max_lease_time; ! } else ! lease_time = default_lease_time; state -> offered_expiry = cur_time + lease_time; *************** *** 697,702 **** } - lt.timestamp = cur_time; - /* Record the uid, if given... */ i = DHO_DHCP_CLIENT_IDENTIFIER; --- 735,738 ---- *************** *** 729,733 **** lease -> hardware_addr.htype = packet -> raw -> htype; memcpy (lease -> hardware_addr.haddr, packet -> raw -> chaddr, ! packet -> raw -> hlen); } else { /* Record the hardware address, if given... */ --- 765,769 ---- lease -> hardware_addr.htype = packet -> raw -> htype; memcpy (lease -> hardware_addr.haddr, packet -> raw -> chaddr, ! sizeof packet -> raw -> chaddr); /* XXX */ } else { /* Record the hardware address, if given... */ *************** *** 735,739 **** lt.hardware_addr.htype = packet -> raw -> htype; memcpy (lt.hardware_addr.haddr, packet -> raw -> chaddr, ! packet -> raw -> hlen); /* Install the new information about this lease in the --- 771,775 ---- lt.hardware_addr.htype = packet -> raw -> htype; memcpy (lt.hardware_addr.haddr, packet -> raw -> chaddr, ! sizeof packet -> raw -> chaddr); /* Install the new information about this lease in the *************** *** 836,839 **** --- 872,876 ---- i = DHO_DHCP_SERVER_IDENTIFIER; if (!state -> options [i]) { + use_primary: state -> options [i] = new_tree_cache ("server-id"); state -> options [i] -> value = *************** *** 846,859 **** state -> options [i] -> timeout = 0xFFFFFFFF; state -> options [i] -> tree = (struct tree *)0; } /* Sanity check the lease time. */ if ((state -> offered_expiry - cur_time) < 15) ! offered_lease_time = (lease -> subnet -> ! group -> default_lease_time); ! else if (state -> offered_expiry - cur_time > ! lease -> subnet -> group -> max_lease_time) ! offered_lease_time = (lease -> subnet -> ! group -> max_lease_time); else offered_lease_time = --- 883,911 ---- state -> options [i] -> timeout = 0xFFFFFFFF; state -> options [i] -> tree = (struct tree *)0; + state -> from.len = + sizeof state -> ip -> primary_address; + memcpy (state -> from.iabuf, + &state -> ip -> primary_address, + state -> from.len); + } else { + /* Find the value of the server identifier... */ + if (!tree_evaluate (state -> options [i])) + goto use_primary; + if (!state -> options [i] -> value || + (state -> options [i] -> len > + sizeof state -> from.iabuf)) + goto use_primary; + + state -> from.len = state -> options [i] -> len; + memcpy (state -> from.iabuf, + state -> options [i] -> value, + state -> from.len); } /* Sanity check the lease time. */ if ((state -> offered_expiry - cur_time) < 15) ! offered_lease_time = default_lease_time; ! else if (state -> offered_expiry - cur_time > max_lease_time) ! offered_lease_time = max_lease_time; else offered_lease_time = *************** *** 951,954 **** --- 1003,1040 ---- } + /* If so directed, use the leased IP address as the router address. + This supposedly makes Win95 machines ARP for all IP addresses, + so if the local router does proxy arp, you win. */ + + ulafdr = 0; + if (lease -> host) { + if (lease -> host -> group -> use_lease_addr_for_default_route) + ulafdr = 1; + } else if (user_class) { + if (user_class -> group -> use_lease_addr_for_default_route) + ulafdr = 1; + } else if (vendor_class) { + if (vendor_class -> group -> use_lease_addr_for_default_route) + ulafdr = 1; + } else if (lease -> subnet -> group -> + use_lease_addr_for_default_route) + ulafdr = 1; + else + ulafdr = 0; + + i = DHO_ROUTERS; + if (ulafdr && !state -> options [i]) { + state -> options [i] = new_tree_cache ("routers"); + state -> options [i] -> flags = TC_TEMPORARY; + state -> options [i] -> value = + lease -> ip_addr.iabuf; + state -> options [i] -> len = + lease -> ip_addr.len; + state -> options [i] -> buf_size = + lease -> ip_addr.len; + state -> options [i] -> timeout = 0xFFFFFFFF; + state -> options [i] -> tree = (struct tree *)0; + } + #ifdef DEBUG_PACKET dump_packet (packet); *************** *** 960,968 **** /* If this is a DHCPOFFER, ping the lease address before actually sending the offer. */ ! if (offer == DHCPOFFER && !(lease -> flags & STATIC_LEASE)) { icmp_echorequest (&lease -> ip_addr); add_timeout (cur_time + 1, lease_ping_timeout, lease); ++outstanding_pings; } else { dhcp_reply (lease); } --- 1046,1057 ---- /* If this is a DHCPOFFER, ping the lease address before actually sending the offer. */ ! if (offer == DHCPOFFER && !(lease -> flags & STATIC_LEASE) && ! cur_time - lease -> timestamp > 60) { ! lease -> timestamp = cur_time; icmp_echorequest (&lease -> ip_addr); add_timeout (cur_time + 1, lease_ping_timeout, lease); ++outstanding_pings; } else { + lease -> timestamp = cur_time; dhcp_reply (lease); } *************** *** 991,995 **** /* Copy in the filename if given; otherwise, flag the filename buffer as available for options. */ ! if (state -> filename) strncpy (raw.file, state -> filename, sizeof raw.file); else --- 1080,1084 ---- /* Copy in the filename if given; otherwise, flag the filename buffer as available for options. */ ! if (state -> filename [0]) strncpy (raw.file, state -> filename, sizeof raw.file); else *************** *** 1003,1008 **** bufs |= 2; /* XXX */ ! memcpy (raw.chaddr, lease -> hardware_addr.haddr, ! lease -> hardware_addr.hlen); raw.hlen = lease -> hardware_addr.hlen; raw.htype = lease -> hardware_addr.htype; --- 1092,1096 ---- bufs |= 2; /* XXX */ ! memcpy (raw.chaddr, lease -> hardware_addr.haddr, sizeof raw.chaddr); raw.hlen = lease -> hardware_addr.hlen; raw.htype = lease -> hardware_addr.htype; *************** *** 1081,1086 **** memset (to.sin_zero, 0, sizeof to.sin_zero); - from = state -> ip -> primary_address; - #ifdef DEBUG_PACKET dump_raw ((unsigned char *)&raw, packet_length); --- 1169,1172 ---- *************** *** 1097,1145 **** to.sin_port = local_port; ! #ifdef USE_FALLBACK ! result = send_fallback (&fallback_interface, ! (struct packet *)0, ! &raw, packet_length, ! raw.siaddr, &to, &hto); ! if (result < 0) ! warn ("send_fallback: %m"); ! free_lease_state (state, "dhcp_reply fallback 1"); ! lease -> state = (struct lease_state *)0; ! return; ! #endif ! /* If it comes from a client who already knows its address and is not requesting a broadcast response, sent it directly to that client. */ } else if (raw.ciaddr.s_addr && state -> offer == DHCPACK && ! !(raw.flags & htons (BOOTP_BROADCAST))) { to.sin_addr = state -> ciaddr; to.sin_port = remote_port; /* XXX */ ! #ifdef USE_FALLBACK ! result = send_fallback (&fallback_interface, ! (struct packet *)0, ! &raw, packet_length, ! raw.siaddr, &to, &hto); ! if (result < 0) ! warn ("send_fallback: %m"); ! free_lease_state (state, "dhcp_reply fallback 1"); ! lease -> state = (struct lease_state *)0; ! return; ! #endif ! ! /* Otherwise, broadcast it on the local network. */ } else { to.sin_addr.s_addr = htonl (INADDR_BROADCAST); to.sin_port = remote_port; /* XXX */ } result = send_packet (state -> ip, (struct packet *)0, &raw, packet_length, ! raw.siaddr, &to, &hto); ! if (result < 0) ! warn ("sendpkt: %m"); free_lease_state (state, "dhcp_reply"); --- 1183,1226 ---- to.sin_port = local_port; ! if (fallback_interface) { ! result = send_packet (fallback_interface, ! (struct packet *)0, ! &raw, packet_length, ! raw.siaddr, &to, &hto); ! free_lease_state (state, "dhcp_reply fallback 1"); ! lease -> state = (struct lease_state *)0; ! return; ! } ! /* If it comes from a client that already knows its address and is not requesting a broadcast response, sent it directly to that client. */ } else if (raw.ciaddr.s_addr && state -> offer == DHCPACK && ! !(raw.flags & htons (BOOTP_BROADCAST)) && ! can_unicast_without_arp ()) { to.sin_addr = state -> ciaddr; to.sin_port = remote_port; /* XXX */ ! if (fallback_interface) { ! result = send_packet (fallback_interface, ! (struct packet *)0, ! &raw, packet_length, ! raw.siaddr, &to, &hto); ! free_lease_state (state, "dhcp_reply fallback 1"); ! lease -> state = (struct lease_state *)0; ! return; ! } } else { + /* Otherwise, broadcast it on the local network. */ to.sin_addr.s_addr = htonl (INADDR_BROADCAST); to.sin_port = remote_port; /* XXX */ } + memcpy (&from, state -> from.iabuf, sizeof from); result = send_packet (state -> ip, (struct packet *)0, &raw, packet_length, ! from, &to, &hto); free_lease_state (state, "dhcp_reply"); *************** *** 1159,1162 **** --- 1240,1256 ---- int i; + /* Figure out what IP address the client is requesting, if any. */ + if (packet -> options [DHO_DHCP_REQUESTED_ADDRESS].len && + packet -> options [DHO_DHCP_REQUESTED_ADDRESS].len == 4) { + cip.len = 4; + memcpy (cip.iabuf, + packet -> options [DHO_DHCP_REQUESTED_ADDRESS].data, + cip.len); + } else if (packet -> raw -> ciaddr.s_addr) { + cip.len = 4; + memcpy (cip.iabuf, &packet -> raw -> ciaddr, 4); + } else + cip.len = 0; + /* Try to find a host or lease that's been assigned to the specified unique client identifier. */ *************** *** 1205,1208 **** --- 1299,1315 ---- } + /* If fixed_lease is present but does not match the requested + IP address, and this is a DHCPREQUEST, then we can't return + any other lease, so we might as well return now. */ + if (packet -> packet_type == DHCPREQUEST && fixed_lease && + (fixed_lease -> ip_addr.len != cip.len || + memcmp (fixed_lease -> ip_addr.iabuf, + cip.iabuf, cip.len))) { + if (ours) + *ours = 1; + strcpy (dhcp_message, "requested address is incorrect"); + return (struct lease *)0; + } + /* Try to find a lease that's been attached to the client's hardware address... */ *************** *** 1225,1240 **** /* Try to find a lease that's been allocated to the client's IP address. */ ! if (packet -> options [DHO_DHCP_REQUESTED_ADDRESS].len && ! packet -> options [DHO_DHCP_REQUESTED_ADDRESS].len == 4) { ! cip.len = 4; ! memcpy (cip.iabuf, ! packet -> options [DHO_DHCP_REQUESTED_ADDRESS].data, ! cip.len); ! ip_lease = find_lease_by_ip_addr (cip); ! } else if (packet -> raw -> ciaddr.s_addr) { ! cip.len = 4; ! memcpy (cip.iabuf, &packet -> raw -> ciaddr, 4); ip_lease = find_lease_by_ip_addr (cip); ! } else ip_lease = (struct lease *)0; --- 1332,1338 ---- /* Try to find a lease that's been allocated to the client's IP address. */ ! if (cip.len) ip_lease = find_lease_by_ip_addr (cip); ! else ip_lease = (struct lease *)0; *************** *** 1252,1283 **** lease to be abandoned. If so, this request probably came from that client. */ ! if (ip_lease && (ip_lease -> shared_network != share)) ip_lease = (struct lease *)0; ! /* Toss ip_lease if it hasn't yet expired and the uid doesn't ! match */ if (ip_lease && ip_lease -> ends >= cur_time && ! ip_lease -> uid && ip_lease != uid_lease) { int i = DHO_DHCP_CLIENT_IDENTIFIER; ! /* If for some reason the client has more than one lease ! on the subnet that matches its uid, pick the one that ! it asked for. It might be nice in some cases to ! release the extraneous leases, but better to leave ! that to a human. */ ! if (packet -> options [i].data && ! ip_lease -> uid_len == packet -> options [i].len && ! !memcmp (packet -> options [i].data, ! ip_lease -> uid, ip_lease -> uid_len)) { ! warn ("client %s has duplicate leases on %s", ! print_hw_addr (packet -> raw -> htype, ! packet -> raw -> hlen, ! packet -> raw -> chaddr), ! ip_lease -> shared_network -> name); ! uid_lease = ip_lease; } - ip_lease = (struct lease *)0; } /* Toss hw_lease if it hasn't yet expired and the uid doesn't match, except that if the hardware address matches and the --- 1350,1428 ---- lease to be abandoned. If so, this request probably came from that client. */ ! if (ip_lease && (ip_lease -> shared_network != share)) { ! if (ours) ! *ours = 1; ip_lease = (struct lease *)0; + strcpy (dhcp_message, "requested address on bad subnet"); + } ! /* Toss ip_lease if it hasn't yet expired and isn't owned by the ! client. */ if (ip_lease && ip_lease -> ends >= cur_time && ! ip_lease != uid_lease) { int i = DHO_DHCP_CLIENT_IDENTIFIER; ! /* Make sure that ip_lease actually belongs to the client, ! and toss it if not. */ ! if ((ip_lease -> uid_len && ! packet -> options [i].data && ! ip_lease -> uid_len == packet -> options [i].len && ! !memcmp (packet -> options [i].data, ! ip_lease -> uid, ip_lease -> uid_len)) || ! (!ip_lease -> uid_len && ! (ip_lease -> hardware_addr.htype == ! packet -> raw -> htype) && ! ip_lease -> hardware_addr.hlen == packet -> raw -> hlen && ! !memcmp (ip_lease -> hardware_addr.haddr, ! packet -> raw -> chaddr, ! ip_lease -> hardware_addr.hlen))) { ! if (uid_lease) { ! if (uid_lease -> ends > cur_time) { ! warn ("client %s has duplicate leases on %s", ! print_hw_addr (packet -> raw -> htype, ! packet -> raw -> hlen, ! packet -> raw -> chaddr), ! ip_lease -> shared_network -> name); ! ! if (uid_lease && ! !packet -> raw -> ciaddr.s_addr) ! release_lease (uid_lease); ! } ! uid_lease = ip_lease; ! } ! } else { ! strcpy (dhcp_message, ! "requested address is not available"); ! ip_lease = (struct lease *)0; ! } ! ! /* If we get to here and fixed_lease is not null, that means ! that there are both a dynamic lease and a fixed-address ! declaration for the same IP address. */ ! if (packet -> packet_type == DHCPREQUEST && fixed_lease) { ! fixed_lease = (struct lease *)0; ! db_conflict: ! warn ("Both dynamic and static leases present for %s.", ! piaddr (cip)); ! warn ("Either remove host declaration %s or remove %s", ! (fixed_lease && fixed_lease -> host ! ? (fixed_lease -> host -> name ! ? fixed_lease -> host -> name : piaddr (cip)) ! : piaddr (cip)), ! piaddr (cip)); ! warn ("from the dynamic address pool for %s", ! ip_lease -> subnet -> shared_network -> name); ! if (fixed_lease) ! ip_lease = (struct lease *)0; ! strcpy (dhcp_message, ! "database conflict - call for help!"); } } + /* If we get to here with both fixed_lease and ip_lease not + null, then we have a configuration file bug. */ + if (packet -> packet_type == DHCPREQUEST && fixed_lease && ip_lease) + goto db_conflict; + /* Toss hw_lease if it hasn't yet expired and the uid doesn't match, except that if the hardware address matches and the *************** *** 1292,1318 **** /* Toss extra pointers to the same lease... */ - if (ip_lease == hw_lease) - ip_lease = (struct lease *)0; if (hw_lease == uid_lease) hw_lease = (struct lease *)0; if (ip_lease == uid_lease) ! ip_lease = (struct lease *)0; ! ! /* If we got an ip address lease, make sure it isn't assigned to ! some *other* client! If it was assigned to this client, we'd ! have zeroed it out above, so the only way we can take it at this ! point is if some other client had it but it's timed out, or if no ! other client has ever had it. */ ! if (ip_lease && ! ip_lease -> ends >= cur_time) ! ip_lease = (struct lease *)0; /* If we've already eliminated the lease, it wasn't there to begin with. If we have come up with a matching lease, set the message to bad network in case we have to throw it out. */ ! if (!ip_lease && !hw_lease && !uid_lease) { strcpy (dhcp_message, "requested address not available"); - } else { - strcpy (dhcp_message, "requested address on bad subnet"); } --- 1437,1452 ---- /* Toss extra pointers to the same lease... */ if (hw_lease == uid_lease) hw_lease = (struct lease *)0; + if (ip_lease == hw_lease) + hw_lease = (struct lease *)0; if (ip_lease == uid_lease) ! uid_lease = (struct lease *)0; /* If we've already eliminated the lease, it wasn't there to begin with. If we have come up with a matching lease, set the message to bad network in case we have to throw it out. */ ! if (!ip_lease) { strcpy (dhcp_message, "requested address not available"); } *************** *** 1320,1337 **** if (ip_lease && (share != ip_lease -> shared_network)) { ! release_lease (ip_lease); ip_lease = (struct lease *)0; } if (uid_lease && (share != uid_lease -> shared_network)) { ! release_lease (uid_lease); uid_lease = (struct lease *)0; } if (hw_lease && (share != hw_lease -> shared_network)) { ! release_lease (hw_lease); hw_lease = (struct lease *)0; } /* At this point, if fixed_lease is nonzero, we can assign it to this client. */ --- 1454,1480 ---- if (ip_lease && (share != ip_lease -> shared_network)) { ! if (packet -> packet_type == DHCPREQUEST) ! release_lease (ip_lease); ip_lease = (struct lease *)0; } if (uid_lease && (share != uid_lease -> shared_network)) { ! if (packet -> packet_type == DHCPREQUEST) ! release_lease (uid_lease); uid_lease = (struct lease *)0; } if (hw_lease && (share != hw_lease -> shared_network)) { ! if (packet -> packet_type == DHCPREQUEST) ! release_lease (hw_lease); hw_lease = (struct lease *)0; } + /* If this is a DHCPREQUEST, make sure the lease we're going to return + matches the requested IP address. If it doesn't, don't return a + lease at all. */ + if (packet -> packet_type == DHCPREQUEST && !ip_lease && !fixed_lease) + return (struct lease *)0; + /* At this point, if fixed_lease is nonzero, we can assign it to this client. */ *************** *** 1392,1399 **** warning message, so that if it continues to lose, the administrator will eventually investigate. */ ! if (lease && lease -> flags & ABANDONED_LEASE) { ! warn ("Reclaiming REQUESTed abandoned IP address %s.", ! piaddr (lease -> ip_addr)); ! lease -> flags &= ~ABANDONED_LEASE; } --- 1535,1545 ---- warning message, so that if it continues to lose, the administrator will eventually investigate. */ ! if (lease && (lease -> flags & ABANDONED_LEASE)) { ! if (packet -> packet_type == DHCPREQUEST) { ! warn ("Reclaiming REQUESTed abandoned IP address %s.", ! piaddr (lease -> ip_addr)); ! lease -> flags &= ~ABANDONED_LEASE; ! } else ! lease = (struct lease *)0; } diff -rNc2 dhcp-2.0b1pl6/server/dhcpd.8 dhcp-2.0b1pl18/server/dhcpd.8 *** dhcp-2.0b1pl6/server/dhcpd.8 Mon Oct 20 14:38:13 1997 --- dhcp-2.0b1pl18/server/dhcpd.8 Fri Mar 5 08:05:27 1999 *************** *** 159,162 **** --- 159,174 ---- flag may used. It should be followed by the udp port number on which dhcpd should listen. This is mostly useful for debugging purposes. + If the + .B -p + flag is specified, the server will transmit responses to clients at a + port number that is one greater than the one specified - i.e., if you + specify + .B -p + 67, then the server will listen on port 67 and transmit to port 68. + Datagrams that must go through relay agents are sent to the port + number specified with the + .B -p + flag - if you wish to use alternate port numbers, you must configure + any relay agents you are using to use the same alternate port numbers. .PP To run dhcpd as a foreground process, rather than allowing it to run diff -rNc2 dhcp-2.0b1pl6/server/dhcpd.c dhcp-2.0b1pl18/server/dhcpd.c *** dhcp-2.0b1pl6/server/dhcpd.c Fri Jun 26 14:11:01 1998 --- dhcp-2.0b1pl18/server/dhcpd.c Fri Mar 5 08:13:54 1999 *************** *** 4,9 **** /* ! * Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. ! * All rights reserved. * * Redistribution and use in source and binary forms, with or without --- 4,9 ---- /* ! * Copyright (c) 1995, 1996, 1997, 1998, 1999 ! * The Internet Software Consortium. All rights reserved. * * Redistribution and use in source and binary forms, with or without *************** *** 43,53 **** #ifndef lint static char ocopyright[] = ! "$Id: dhcpd.c,v 1.45.2.2 1998/06/26 21:11:01 mellon Exp $ Copyright 1995, 1996, 1997, 1998 The Internet Software Consortium."; #endif static char copyright[] = ! "Copyright 1995, 1996, 1997, 1998 The Internet Software Consortium."; static char arr [] = "All rights reserved."; ! static char message [] = "Internet Software Consortium DHCPD $Name: V2-BETA-1-PATCHLEVEL-6 $"; #include "dhcpd.h" --- 43,55 ---- #ifndef lint static char ocopyright[] = ! "$Id: dhcpd.c,v 1.45.2.18 1999/03/05 16:13:54 mellon Exp $ Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium."; #endif static char copyright[] = ! "Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium."; static char arr [] = "All rights reserved."; ! static char message [] = "Internet Software Consortium DHCP Server V2.0b1pl18 "; ! static char contrib [] = "\nPlease contribute if you find this software useful."; ! static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html\n"; #include "dhcpd.h" *************** *** 61,68 **** int server_identifier_matched; - #ifdef USE_FALLBACK - struct interface_info fallback_interface; - #endif - u_int16_t local_port; u_int16_t remote_port; --- 63,66 ---- *************** *** 174,177 **** --- 172,177 ---- note (copyright); note (arr); + note (contrib); + note (url); } *************** *** 206,210 **** /* Discover all the network interfaces and initialize them. */ ! discover_interfaces (1); /* Initialize icmp support... */ --- 206,210 ---- /* Discover all the network interfaces and initialize them. */ ! discover_interfaces (DISCOVER_SERVER); /* Initialize icmp support... */ *************** *** 229,233 **** /* If the previous server process is not still running, write a new pid file immediately. */ ! if (pid && kill (pid, 0) < 0) { unlink (path_dhcpd_pid); if ((i = open (path_dhcpd_pid, --- 229,233 ---- /* If the previous server process is not still running, write a new pid file immediately. */ ! if (pid && (pid == getpid () || kill (pid, 0) < 0)) { unlink (path_dhcpd_pid); if ((i = open (path_dhcpd_pid, *************** *** 238,242 **** pidfilewritten = 1; } ! } } --- 238,243 ---- pidfilewritten = 1; } ! } else ! error ("There's already a DHCP server running.\n"); } diff -rNc2 dhcp-2.0b1pl6/server/dhcpd.conf dhcp-2.0b1pl18/server/dhcpd.conf *** dhcp-2.0b1pl6/server/dhcpd.conf Tue Aug 27 18:30:38 1996 --- dhcp-2.0b1pl18/server/dhcpd.conf Tue Feb 23 09:49:00 1999 *************** *** 1,65 **** # dhcpd.conf # ! # Configuration file for ISC dhcpd # - # Hosts with more than one interface MUST specify a ``server-identifier'', - # which should be the IP address of the server's primary network interface, - # or if there is no interface that can be described that way, at least an - # interface whose address isn't likely to change. - - server-identifier toccata.fugue.com; - # option definitions common to all supported networks... option domain-name "fugue.com"; option domain-name-servers toccata.fugue.com; ! # Shared network declaration is used to group subnets which share the same ! # physical network together. The name is specified so that the shared ! # network can be referred to in log messages - it serves no other function. ! ! shared-network FUGUE { ! ! # option definitions common to this shared network. ! option subnet-mask 255.255.255.224; ! default-lease-time 600; ! max-lease-time 7200; ! ! # One of the two IP subnets that share this physical network ! # ! # Address ranges can be specified for each subnet attached to ! # a shared network. Since these subnets share the same physical ! # network, addresses are pooled together, and assignments are made ! # without regard to the actual subnet. If the optional dynamic-bootp ! # keyword is given in the address range declaration, then addresses ! # in that range can be assigned either with the DHCP protocol or the ! # BOOTP protocol; otherwise, only DHCP clients will have addresses ! # allocated from the address range. ! # ! # Note that each IP subnet can have its own options specific to that subnet. ! # options that aren't specified in the subnet are taken from the shared ! # network (if any) and then from the global option list. ! ! subnet 204.254.239.0 netmask 255.255.255.224 { ! range 204.254.239.10 204.254.239.20; ! option broadcast-address 204.254.239.31; ! option routers prelude.fugue.com; ! } # The other subnet that shares this physical network ! subnet 204.254.239.32 netmask 255.255.255.224 { ! range dynamic-bootp 204.254.239.10 204.254.239.20; ! option broadcast-address 204.254.239.31; ! option routers snarg.fugue.com; ! } } - - # IP subnets that are alone on their physical wire should be declared by - # themselves. ISC dhcpd may still refer to them as shared networks in - # log messages, but this is simply an artifact of the underlying data - # structures. - # - # Note that options can be specified in the subnet declaration which - # supersede the global options specified earlier. subnet 192.5.5.0 netmask 255.255.255.224 { --- 1,27 ---- # dhcpd.conf # ! # Sample configuration file for ISC dhcpd # # option definitions common to all supported networks... option domain-name "fugue.com"; option domain-name-servers toccata.fugue.com; ! option subnet-mask 255.255.255.224; ! default-lease-time 600; ! max-lease-time 7200; ! ! subnet 204.254.239.0 netmask 255.255.255.224 { ! range 204.254.239.10 204.254.239.20; ! option broadcast-address 204.254.239.31; ! option routers prelude.fugue.com; ! } # The other subnet that shares this physical network ! subnet 204.254.239.32 netmask 255.255.255.224 { ! range dynamic-bootp 204.254.239.10 204.254.239.20; ! option broadcast-address 204.254.239.31; ! option routers snarg.fugue.com; } subnet 192.5.5.0 netmask 255.255.255.224 { diff -rNc2 dhcp-2.0b1pl6/server/dhcpd.conf.5 dhcp-2.0b1pl18/server/dhcpd.conf.5 *** dhcp-2.0b1pl6/server/dhcpd.conf.5 Fri Jun 26 14:07:11 1998 --- dhcp-2.0b1pl18/server/dhcpd.conf.5 Tue Feb 23 09:49:50 1999 *************** *** 1,6 **** .\" dhcpd.conf.5 .\" ! .\" Copyright (c) 1995, 1996 The Internet Software Consortium. ! .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without --- 1,6 ---- .\" dhcpd.conf.5 .\" ! .\" Copyright (c) 1995, 1996, 1997, 1998, 1998, 1999 ! .\" The Internet Software Consortium. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without *************** *** 664,667 **** --- 664,723 ---- .PP .B The + .I authoritative + .B statement + .PP + \fBauthoritative;\fR + .PP + \fBnot authoritative;\fR + .PP + The DHCP server will normally assume that the configuration + information about a given network segment is known to be correct and + is authoritative. So if a client requests an IP address on a given + network segment that the server knows is not valid for that segment, + the server will respond with a DHCPNAK message, causing the client to + forget its IP address and try to get a new one. + .PP + If a DHCP server is being configured by somebody who is not the + network administrator and who therefore does not wish to assert this + level of authority, then the statement "not authoritative" should be + written in the appropriate scope in the configuration file. + .PP + Usually, writing \fBnot authoritative;\fR at the top level of the file + should be sufficient. However, if a DHCP server is to be set up so + that it is aware of some networks for which it is authoritative and + some networks for which it is not, it may be more appropriate to + declare authority on a per-network-segment basis. + .PP + Note that the most specific scope for which the concept of authority + makes any sense is the physical network segment - either a + shared-network statement or a subnet statement that is not contained + within a shared-network statement. It is not meaningful to specify + that the server is authoritative for some subnets within a shared + network, but not authoritative for others, nor is it meaningful to + specify that the server is authoritative for some host declarations + and not others. + .PP + .B The + .I use-lease-addr-for-default-route + .B statement + .PP + \fBuse-lease-addr-for-default-route\fR \fIflag\fR\fB;\fR + .PP + If the \fIuse-lease-addr-for-default-route\fR parameter is true in a + given scope, then instead of sending the value specified in the + routers option (or sending no value at all), the IP address of the + lease being assigned is sent to the client. This supposedly causes + Win95 machines to ARP for all IP addresses, which can be helpful if + your router is configured for proxy ARP. + .PP + If use-lease-addr-for-default-route is enabled and an option routers + statement are both in scope, the routers option will be preferred. + The rationale for this is that in situations where you want to use + this feature, you probably want it enabled for a whole bunch of + Windows 95 machines, and you want to override it for a few other + machines. Unfortunately, if the opposite happens to be true for you + site, you are probably better off not trying to use this flag. + .PP + .B The .I server-identifier .B statement *************** *** 678,685 **** sent on occasions where the default value would be incorrect. The default value is the first IP address associated with the physical network interface ! on which the request arrived. The usual case where the \fIserver-identifier\fR statement needs to be sent is when a physical interface has more than one IP address, and the one being sent by default isn't appropriate for some or all clients served by that interface. .SH REFERENCE: OPTION STATEMENTS .PP --- 734,749 ---- sent on occasions where the default value would be incorrect. The default value is the first IP address associated with the physical network interface ! on which the request arrived. ! .PP ! The usual case where the \fIserver-identifier\fR statement needs to be sent is when a physical interface has more than one IP address, and the one being sent by default isn't appropriate for some or all clients served by that interface. + Another common case is when an alias is defined for the purpose of + having a consistent IP address for the DHCP server, and it is desired + that the clients use this IP address when contacting the server. + .PP + Supplying a value for the dhcp-server-identifier option is equivalent + to using the server-identifier statement. .SH REFERENCE: OPTION STATEMENTS .PP diff -rNc2 dhcp-2.0b1pl6/server/dhcpd.conf.cat5 dhcp-2.0b1pl18/server/dhcpd.conf.cat5 *** dhcp-2.0b1pl6/server/dhcpd.conf.cat5 Fri Nov 21 23:15:53 1997 --- dhcp-2.0b1pl18/server/dhcpd.conf.cat5 Tue Feb 23 14:12:51 1999 *************** *** 517,524 **** in the _h_o_s_t statement. _h_a_r_d_w_a_r_e_-_t_y_p_e must be the name of a physical hardware interface type. Currently, only the ! eetthheerrnneett type is recognized, although support for ttookkeenn-- ! rriinngg and ffddddii hardware types would also be desirable. The ! _h_a_r_d_w_a_r_e_-_a_d_d_r_e_s_s should be a set of hexadecimal octets ! (numbers from 0 through ff) seperated by colons. The --- 517,524 ---- in the _h_o_s_t statement. _h_a_r_d_w_a_r_e_-_t_y_p_e must be the name of a physical hardware interface type. Currently, only the ! eetthheerrnneett and ttookkeenn--rriinngg types are recognized, although ! support for a ffddddii hardware type (and others) would also ! be desirable. The _h_a_r_d_w_a_r_e_-_a_d_d_r_e_s_s should be a set of ! hexadecimal octets (numbers from 0 through ff) seperated *************** *** 533,537 **** ! _h_a_r_d_w_a_r_e_f_R _s_t_a_t_e_m_e_n_t _m_a_y _a_l_s_o _b_e _u_s_e_d _f_o_r _D_H_C_P _c_l_i_e_n_t_s_. TThhee _f_i_l_e_n_a_m_e ssttaatteemmeenntt --- 533,538 ---- ! by colons. The _h_a_r_d_w_a_r_e_f_R _s_t_a_t_e_m_e_n_t _m_a_y _a_l_s_o _b_e _u_s_e_d _f_o_r ! _D_H_C_P _c_l_i_e_n_t_s_. TThhee _f_i_l_e_n_a_m_e ssttaatteemmeenntt *************** *** 539,546 **** ffiilleennaammee ""_f_i_l_e_n_a_m_e"";; ! The _f_i_l_e_n_a_m_e statement can be used to specify the name of ! the initial boot file which is to be loaded by a client. The _f_i_l_e_n_a_m_e should be a filename recognizable to whatever ! file transfer protocol the client can be expected to use to load the file. --- 540,547 ---- ffiilleennaammee ""_f_i_l_e_n_a_m_e"";; ! The _f_i_l_e_n_a_m_e statement can be used to specify the name of ! the initial boot file which is to be loaded by a client. The _f_i_l_e_n_a_m_e should be a filename recognizable to whatever ! file transfer protocol the client can be expected to use to load the file. *************** *** 557,565 **** nneexxtt--sseerrvveerr _s_e_r_v_e_r_-_n_a_m_e;; ! The _n_e_x_t_-_s_e_r_v_e_r statement is used to specify the host ! address of the server from which the initial boot file ! (specified in the _f_i_l_e_n_a_m_e statement) is to be loaded. ! _S_e_r_v_e_r_-_n_a_m_e should be a numeric IP address or a domain ! name. If no _n_e_x_t_-_s_e_r_v_e_r parameter applies to a given client, the DHCP server's IP address is used. --- 558,566 ---- nneexxtt--sseerrvveerr _s_e_r_v_e_r_-_n_a_m_e;; ! The _n_e_x_t_-_s_e_r_v_e_r statement is used to specify the host ! address of the server from which the initial boot file ! (specified in the _f_i_l_e_n_a_m_e statement) is to be loaded. ! _S_e_r_v_e_r_-_n_a_m_e should be a numeric IP address or a domain ! name. If no _n_e_x_t_-_s_e_r_v_e_r parameter applies to a given client, the DHCP server's IP address is used. *************** *** 568,579 **** ffiixxeedd--aaddddrreessss _a_d_d_r_e_s_s [,, _a_d_d_r_e_s_s ... ];; ! The _f_i_x_e_d_-_a_d_d_r_e_s_s statement is used to assign one or more ! fixed IP addresses to a client. It should only appear in a _h_o_s_t declaration. If more than one address is supplied, ! then when the client boots, it will be assigned the ! address which corresponds to the network on which it is ! booting. If none of the addresses in the _f_i_x_e_d_-_a_d_d_r_e_s_s ! statement are on the network on which the client is boot­ ! ing, that client will not match the _h_o_s_t declaration con­ taining that _f_i_x_e_d_-_a_d_d_r_e_s_s statement. Each _a_d_d_r_e_s_s should be either an IP address or a domain name which resolves to --- 569,580 ---- ffiixxeedd--aaddddrreessss _a_d_d_r_e_s_s [,, _a_d_d_r_e_s_s ... ];; ! The _f_i_x_e_d_-_a_d_d_r_e_s_s statement is used to assign one or more ! fixed IP addresses to a client. It should only appear in a _h_o_s_t declaration. If more than one address is supplied, ! then when the client boots, it will be assigned the ! address which corresponds to the network on which it is ! booting. If none of the addresses in the _f_i_x_e_d_-_a_d_d_r_e_s_s ! statement are on the network on which the client is boot­ ! ing, that client will not match the _h_o_s_t declaration con­ taining that _f_i_x_e_d_-_a_d_d_r_e_s_s statement. Each _a_d_d_r_e_s_s should be either an IP address or a domain name which resolves to *************** *** 584,590 **** ddyynnaammiicc--bboooottpp--lleeaassee--ccuuttooffff _d_a_t_e;; ! The _d_y_n_a_m_i_c_-_b_o_o_t_p_-_l_e_a_s_e_-_c_u_t_o_f_f statement sets the ending time for all leases assigned dynamically to BOOTP clients. - Because BOOTP clients do not have any way of renewing --- 585,590 ---- ddyynnaammiicc--bboooottpp--lleeaassee--ccuuttooffff _d_a_t_e;; ! The _d_y_n_a_m_i_c_-_b_o_o_t_p_-_l_e_a_s_e_-_c_u_t_o_f_f statement sets the ending time for all leases assigned dynamically to BOOTP clients. *************** *** 599,606 **** ! leases, and don't know that their leases could expire, by default dhcpd assignes infinite leases to all BOOTP clients. However, it may make sense in some situations to ! set a cutoff date for all BOOTP leases - for example, the end of a school term, or the time at night when a facility is closed and all machines are required to be powered off. --- 599,607 ---- ! Because BOOTP clients do not have any way of renewing ! leases, and don't know that their leases could expire, by default dhcpd assignes infinite leases to all BOOTP clients. However, it may make sense in some situations to ! set a cutoff date for all BOOTP leases - for example, the end of a school term, or the time at night when a facility is closed and all machines are required to be powered off. *************** *** 611,620 **** W YYYY/MM/DD HH:MM:SS ! W is the day of the week expressed as a number from zero ! (Sunday) to six (Saturday). YYYY is the year, including the century. MM is the month expressed as a number from 1 ! to 12. DD is the day of the month, counting from 1. HH ! is the hour, from zero to 23. MM is the minute and SS is ! the second. The time is always in Greenwich Mean Time (GMT), not local time. --- 612,621 ---- W YYYY/MM/DD HH:MM:SS ! W is the day of the week expressed as a number from zero ! (Sunday) to six (Saturday). YYYY is the year, including the century. MM is the month expressed as a number from 1 ! to 12. DD is the day of the month, counting from 1. HH ! is the hour, from zero to 23. MM is the minute and SS is ! the second. The time is always in Greenwich Mean Time (GMT), not local time. *************** *** 623,635 **** ddyynnaammiicc--bboooottpp--lleeaassee--lleennggtthh _l_e_n_g_t_h;; ! The _d_y_n_a_m_i_c_-_b_o_o_t_p_-_l_e_a_s_e_-_l_e_n_g_t_h statement is used to set ! the length of leases dynamically assigned to BOOTP ! clients. At some sites, it may be possible to assume ! that a lease is no longer in use if its holder has not ! used BOOTP or DHCP to get its address within a certain time period. The period is specified in _l_e_n_g_t_h as a num­ ! ber of seconds. If a client reboots using BOOTP during the timeout period, the lease duration is reset to _l_e_n_g_t_h, ! so a BOOTP client that boots frequently enough will never lose its lease. Needless to say, this parameter should be adjusted with extreme caution. --- 624,636 ---- ddyynnaammiicc--bboooottpp--lleeaassee--lleennggtthh _l_e_n_g_t_h;; ! The _d_y_n_a_m_i_c_-_b_o_o_t_p_-_l_e_a_s_e_-_l_e_n_g_t_h statement is used to set ! the length of leases dynamically assigned to BOOTP ! clients. At some sites, it may be possible to assume ! that a lease is no longer in use if its holder has not ! used BOOTP or DHCP to get its address within a certain time period. The period is specified in _l_e_n_g_t_h as a num­ ! ber of seconds. If a client reboots using BOOTP during the timeout period, the lease duration is reset to _l_e_n_g_t_h, ! so a BOOTP client that boots frequently enough will never lose its lease. Needless to say, this parameter should be adjusted with extreme caution. *************** *** 639,648 **** ggeett--lleeaassee--hhoossttnnaammeess _f_l_a_g;; ! The _g_e_t_-_l_e_a_s_e_-_h_o_s_t_n_a_m_e_s statement is used to tell dhcpd whether or not to look up the domain name corresponding to ! the IP address of each address in the lease pool and use ! that address for the DHCP _h_o_s_t_n_a_m_e option. If _f_l_a_g is ! true, then this lookup is done for all addresses in the ! current scope. By default, or if _f_l_a_g is false, no lookups are done. --- 640,649 ---- ggeett--lleeaassee--hhoossttnnaammeess _f_l_a_g;; ! The _g_e_t_-_l_e_a_s_e_-_h_o_s_t_n_a_m_e_s statement is used to tell dhcpd whether or not to look up the domain name corresponding to ! the IP address of each address in the lease pool and use ! that address for the DHCP _h_o_s_t_n_a_m_e option. If _f_l_a_g is ! true, then this lookup is done for all addresses in the ! current scope. By default, or if _f_l_a_g is false, no lookups are done. *************** *** 651,656 **** uussee--hhoosstt--ddeeccll--nnaammeess _f_l_a_g;; ! If the _u_s_e_-_h_o_s_t_-_d_e_c_l_-_n_a_m_e_s parameter is true in a given ! scope, then for every host declaration within that scope, --- 652,656 ---- uussee--hhoosstt--ddeeccll--nnaammeess _f_l_a_g;; ! If the _u_s_e_-_h_o_s_t_-_d_e_c_l_-_n_a_m_e_s parameter is true in a given *************** *** 665,669 **** ! the name provided for the host declaration will be sup­ plied to the client as its hostname. So, for example, --- 665,670 ---- ! scope, then for every host declaration within that scope, ! the name provided for the host declaration will be sup­ plied to the client as its hostname. So, for example, *************** *** 685,697 **** } ! An _o_p_t_i_o_n _h_o_s_t_-_n_a_m_e statement within a host declaration will override the use of the name in the host declaration. TThhee _s_e_r_v_e_r_-_i_d_e_n_t_i_f_i_e_r ssttaatteemmeenntt sseerrvveerr--iiddeennttiiffiieerr _h_o_s_t_n_a_m_e;; ! The server-identifier statement is now obsolete and is ! ignored by the DHCP server. RREEFFEERREENNCCEE:: OOPPTTIIOONN SSTTAATTEEMMEENNTTSS --- 686,802 ---- } ! An _o_p_t_i_o_n _h_o_s_t_-_n_a_m_e statement within a host declaration will override the use of the name in the host declaration. + TThhee _a_u_t_h_o_r_i_t_a_t_i_v_e ssttaatteemmeenntt + + aauutthhoorriittaattiivvee;; + + nnoott aauutthhoorriittaattiivvee;; + + The DHCP server will normally assume that the configura­ + tion information about a given network segment is known to + be correct and is authoritative. So if a client requests + an IP address on a given network segment that the server + knows is not valid for that segment, the server will + respond with a DHCPNAK message, causing the client to for­ + get its IP address and try to get a new one. + + If a DHCP server is being configured by somebody who is + not the network administrator and who therefore does not + wish to assert this level of authority, then the statement + "not authoritative" should be written in the appropriate + scope in the configuration file. + + Usually, writing nnoott aauutthhoorriittaattiivvee;; at the top level of + the file should be sufficient. However, if a DHCP server + is to be set up so that it is aware of some networks for + which it is authoritative and some networks for which it + is not, it may be more appropriate to declare authority on + a per-network-segment basis. + + Note that the most specific scope for which the concept of + authority makes any sense is the physical network segment + - either a shared-network statement or a subnet statement + + + + 11 + + + + + + dhcpd.conf(5) dhcpd.conf(5) + + + that is not contained within a shared-network statement. + It is not meaningful to specify that the server is author­ + itative for some subnets within a shared network, but not + authoritative for others, nor is it meaningful to specify + that the server is authoritative for some host declara­ + tions and not others. + + TThhee _u_s_e_-_l_e_a_s_e_-_a_d_d_r_-_f_o_r_-_d_e_f_a_u_l_t_-_r_o_u_t_e ssttaatteemmeenntt + + uussee--lleeaassee--aaddddrr--ffoorr--ddeeffaauulltt--rroouuttee _f_l_a_g;; + + If the _u_s_e_-_l_e_a_s_e_-_a_d_d_r_-_f_o_r_-_d_e_f_a_u_l_t_-_r_o_u_t_e parameter is true + in a given scope, then instead of sending the value speci­ + fied in the routers option (or sending no value at all), + the IP address of the lease being assigned is sent to the + client. This supposedly causes Win95 machines to ARP for + all IP addresses, which can be helpful if your router is + configured for proxy ARP. + + If use-lease-addr-for-default-route is enabled and an + option routers statement are both in scope, the routers + option will be preferred. The rationale for this is that + in situations where you want to use this feature, you + probably want it enabled for a whole bunch of Windows 95 + machines, and you want to override it for a few other + machines. Unfortunately, if the opposite happens to be + true for you site, you are probably better off not trying + to use this flag. + TThhee _s_e_r_v_e_r_-_i_d_e_n_t_i_f_i_e_r ssttaatteemmeenntt sseerrvveerr--iiddeennttiiffiieerr _h_o_s_t_n_a_m_e;; ! The server-identifier statement can be used to define the ! value that is sent in the DHCP Server Identifier option ! for a given scope. The value specified mmuusstt be an IP ! address for the DHCP server, and must be reachable by all ! clients served by a particular scope. ! ! The use of the server-identifier statement is not recom­ ! mended - the only reason to use it is to force a value ! other than the default value to be sent on occasions where ! the default value would be incorrect. The default value ! is the first IP address associated with the physical net­ ! work interface on which the request arrived. ! ! The usual case where the _s_e_r_v_e_r_-_i_d_e_n_t_i_f_i_e_r statement needs ! to be sent is when a physical interface has more than one ! IP address, and the one being sent by default isn't appro­ ! priate for some or all clients served by that interface. ! Another common case is when an alias is defined for the ! purpose of having a consistent IP address for the DHCP ! server, and it is desired that the clients use this IP ! address when contacting the server. ! ! ! ! 12 ! ! ! ! ! ! dhcpd.conf(5) dhcpd.conf(5) ! ! ! Supplying a value for the dhcp-server-identifier option is ! equivalent to using the server-identifier statement. RREEFFEERREENNCCEE:: OOPPTTIIOONN SSTTAATTEEMMEENNTTSS *************** *** 722,726 **** ! 11 --- 827,858 ---- ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! 13