diff -rNc2 dhcp-2.0b1pl27/README dhcp-2.0/README *** dhcp-2.0b1pl27/README Sat Apr 24 09:44:03 1999 --- dhcp-2.0/README Tue Jun 22 07:29:34 1999 *************** *** 1,6 **** Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 27 ! April 23, 1999 Documentation for this software includes this README file, the --- 1,37 ---- Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2 ! June 22, 1999 ! ! README FILE ! ! You should read this file carefully before trying to install or use ! the ISC DHCP Distribution. ! ! TABLE OF CONTENTS ! ! 1 WHERE TO FIND DOCUMENTATION ! 2 RELEASE STATUS ! 3 BUILDING THE DHCP DISTRIBUTION ! 4 INSTALLING THE DHCP DISTRIBUTION ! 5 USING THE DHCP DISTRIBUTION ! 5.1 LINUX ! 5.1.1 SO_ATTACH_FILTER UNDECLARED ! 5.1.2 PROTOCOL NOT CONFIGURED ! 5.1.3 BROADCAST ! 5.1.4 FIREWALL RULES ! 5.1.5 IP BOOTP AGENT ! 5.1.6 MULTIPLE INTERFACES ! 5.2 SCO ! 5.3 HP-UX ! 5.4 ULTRIX ! 5.5 FreeBSD ! 5.6 NeXTSTEP ! 5.7 SOLARIS ! 6 SUPPORT ! 6.1 HOW TO REPORT BUGS ! 7 KNOWN BUGS ! ! WHERE TO FIND DOCUMENTATION Documentation for this software includes this README file, the *************** *** 16,20 **** Server configuration documentation is in the dhcpd.conf man page as well as the dhcp-options man page. A sample DHCP server ! configuration is in the file server/dhcpd.conf. DHCP Client documentation is in the dhclient man page. DHCP client --- 47,54 ---- Server configuration documentation is in the dhcpd.conf man page as well as the dhcp-options man page. A sample DHCP server ! configuration is in the file server/dhcpd.conf. The source for the ! dhcpd, dhcpd.leases and dhcpd.conf man pages is in the server/ sub- ! directory in the distribution. The source for the dhcp-options.5 ! man page is in the common/ subdirectory. DHCP Client documentation is in the dhclient man page. DHCP client *************** *** 23,31 **** documented in the dhclient-script man page. The format of the DHCP client lease database is documented in the dhclient.leases man page. ! DHCP relay agent documentation is in the dhcrelay man page. To read installed manual pages, use the man command. Type "man page" ! where page is the name of the manual page. If you want to read manual pages that aren't installed, you can type --- 57,71 ---- documented in the dhclient-script man page. The format of the DHCP client lease database is documented in the dhclient.leases man page. + The source for all these man pages is in the client/ subdirectory in + the distribution. In addition, the dhcp-options man page should be + referred to for information about DHCP options. ! DHCP relay agent documentation is in the dhcrelay man page, the source ! for which is distributed in the relay/ subdirectory. To read installed manual pages, use the man command. Type "man page" ! where page is the name of the manual page. This will only work if ! you have installed the ISC DHCP distribution using the ``make install'' ! command (described later). If you want to read manual pages that aren't installed, you can type *************** *** 34,38 **** is the name of the manual page, followed by '.', followed by some number - 5 for documentation about files, and 8 for documentation ! about programs. If you do not have the nroff command, you can type ``more catpage'' --- 74,81 ---- is the name of the manual page, followed by '.', followed by some number - 5 for documentation about files, and 8 for documentation ! about programs. For example, to read the dhcp-options man page, ! you would type ``nroff -man common/dhcp-options.5 |more'', assuming ! your current working directory is the top level directory of the ISC ! DHCP Distribution. If you do not have the nroff command, you can type ``more catpage'' *************** *** 45,63 **** system. ! This is the first Beta release of Version 2 of the Internet Software Consortium DHCP Distribution. In version 2.0, this distribution includes a DHCP server, a DHCP client, and a BOOTP/DHCP relay agent. ! This beta is believed to be fairly stable. However, DHCP server users ! running a production environment should probably still use version ! 1.0, which is more stable, having been in a feature freeze since ! November of 1996. In this release, the server and relay agent currently work well on NetBSD, Linux after kernel version 2.0.30, FreeBSD, BSD/OS, Ultrix, ! Digital Alpha OSF/1, Solaris and SunOS 4.1.4. They run on AIX, HPUX, ! IRIX and Linux 2.0.30 and earlier kernels but support only a single ! broadcast network interface. 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. The DHCP client currently only knows how to configure the network on --- 88,105 ---- system. ! RELEASE STATUS ! ! This is the final release of Version 2 of the Internet Software Consortium DHCP Distribution. In version 2.0, this distribution includes a DHCP server, a DHCP client, and a BOOTP/DHCP relay agent. ! This release is stable. In this release, the server and relay agent currently work well on NetBSD, Linux after kernel version 2.0.30, FreeBSD, BSD/OS, Ultrix, ! Digital Alpha OSF/1, Solaris and SunOS 4.1.4. On AIX, HPUX, IRIX and ! Linux 2.0.30, only a single broadcast network interface is supported. ! 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. The DHCP client currently only knows how to configure the network on *************** *** 87,96 **** the tar utility and the gzip command - type something like: ! zcat dhcp-2.0b1pl27.tar.gz |tar xvf - On BSD/OS, you have to type gzcat, not zcat, and you may run into similar problems on other operating systems. ! Now, cd to the dhcp-2.0b1pl27 subdirectory that you've just created and configure the source tree by typing: --- 129,138 ---- the tar utility and the gzip command - type something like: ! zcat dhcp-2.0b1pl29.tar.gz |tar xvf - On BSD/OS, you have to type gzcat, not zcat, and you may run into similar problems on other operating systems. ! Now, cd to the dhcp-2.0b1pl29 subdirectory that you've just created and configure the source tree by typing: *************** *** 113,116 **** --- 155,160 ---- Distribution working. + INSTALLING THE DHCP DISTRIBUTION + Once you have successfully gotten the DHCP Distribution to build, you can install it by typing ``make install''. If you already have an old *************** *** 118,121 **** --- 162,167 ---- before typing ``make install''. + USING THE DHCP DISTRIBUTION + LINUX *************** *** 197,200 **** --- 243,261 ---- specify the network interface you *are* using in your route command. + LINUX: FIREWALL RULES + + If you are running the DHCP server or client on a Linux system that's + also acting as a firewall, you must be sure to allow DHCP packets + through the firewall - Linux firewalls make filtering decisions before + they make the forwarding decision, so they will filter packets that + are intended for the firewall itself, as well as packets intended to + be forwarded. In particular, your firewall rules _must_ allow + packets from IP address 0.0.0.0 to IP address 255.255.255.255 from UDP + port 68 to UDP port 67 through. They must also allow packets from + your local firewall's IP address and UDP port 67 through to any + address your DHCP server might serve on UDP port 68. Finally, + packets from relay agents on port 67 to the DHCP server on port 67, + and vice versa, must be permitted. + LINUX: IP BOOTP AGENT *************** *** 207,216 **** LINUX: MULTIPLE INTERFACES ! Most older versions of the Linux kernel do not provide a networking ! API that allows dhcpd to operate correctly if the system has more than ! one broadcast network interface. However, Linux 2.0 kernels with ! version numbers greater than or equal to 2.0.31 add an API feature: ! the SO_BINDTODEVICE socket option. If SO_BINDTODEVICE is present, it ! 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 --- 268,277 ---- LINUX: MULTIPLE INTERFACES ! Very old versions of the Linux kernel do not provide a networking API ! that allows dhcpd to operate correctly if the system has more than one ! broadcast network interface. However, Linux 2.0 kernels with version ! numbers greater than or equal to 2.0.31 add an API feature: the ! SO_BINDTODEVICE socket option. If SO_BINDTODEVICE is present, it 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 *************** *** 222,225 **** --- 283,290 ---- the Linux kernel gurus will get this straight eventually. + Linux 2.1 and later kernels do not use SO_BINDTODEVICE or require the + broadcast address hack, but do support multiple interfaces, using the + Linux Packet Filter. + SCO *************** *** 336,339 **** --- 401,406 ---- PLEASE READ THIS README FILE CAREFULLY BEFORE REPORTING BUGS! + HOW TO REPORT BUGS + When you report bugs, please provide us complete information. A list of information we need follows. Please read it carefully, and put *************** *** 410,422 **** it. ! BUGS This release of the DHCP Distribution does not yet contain support for ! DHCPINFORM. Support for DHCPINFORM will be present in the release at ! a later time. DHCPINFORM is somewhat tangential to the main purpose ! of the DHCP protocol, so this probably won't be a major problem for ! most users. ! ! Vendor tags and User tags are not currently supported. ! ! These two omissions are fixed in the 3.0 release. --- 477,484 ---- it. ! KNOWN BUGS This release of the DHCP Distribution does not yet contain support for ! DHCPINFORM. The Vendor Specific Data option is not supported. Site- ! specific options are not supported. All of these are supported in the ! 3.0 release of the DHCP distribution, which is now in beta testing. diff -rNc2 dhcp-2.0b1pl27/RELNOTES dhcp-2.0/RELNOTES *** dhcp-2.0b1pl27/RELNOTES Sat Apr 24 12:39:58 1999 --- dhcp-2.0/RELNOTES Tue Jun 22 07:49:38 1999 *************** *** 1,56 **** Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 27 ! April 23, 1999 Release Notes ! This is the first Beta release of Version 2 of the Internet Software ! Consortium DHCP Distribution. This beta is believed to be fairly ! stable. ! ! PLANS ! ! 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 ! DHCP/BOOTP Relay Agent to the DHCP Server that was offered in version ! 1.0. In addition, some new capabilities have been added to the ! server: ! ! - IP addresses are now tested before they are assigned to ! clients. This allows the DHCP server to detect rogue ! machines that may have hijacked IP addresses before an IP ! address conflict can occur. ! ! - The server may be configured so that some DHCP clients can ! be excluded from booting. ! ! - Improved NAKing behaviour, so that clients that are using ! addresses other than the one the server knows they should be ! 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 26 --- 1,71 ---- Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2 ! June 22, 1999 Release Notes ! Version 2 of the ISC DHCP Distribution includes the ISC DHCP server, ! DHCP Client and DHCP/BOOTP Relay Agent. This version has been in a near feature freeze since January of 1998, ! was in Beta test from that time to June of 1999, and has now been ! released in its final form. It has a number of important features, ! and is the release that we would expect most sites to run. ! ! For information on how to install, configure and run this software, ! as well as how to find documentation and report bugs, please consult ! the README file. ! ! CHANGELOG ! ! This log describes the changes that have been made in version 2.0 ! since June of 1997. ! ! CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 29 ! ! - Define BYTE_ORDER in includes/cf/hpux.h so that ip.h will compile ! correctly on HP-UX. ! ! - Fix a long-standing but minor bug in the way the program name for ! syslog was derived. ! ! - Fix a long-standing bug that prevented the DHCP server from broadcasting ! responses to BOOTP clients that requested a broadcast response. ! ! - In dhcprequest(), check to make sure that there's a lease before trying ! to acknowledge it to the client. This fixes a potential core dump that ! a few people observed. ! ! CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 28 ! ! - Fix some pastos I introduced when merging Andrew Chittenden's token ! ring support. ! ! - Apply a patch to the token ring support from Andrew Chittenden. ! ! CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 27 ! ! - Add dependencies to makefiles. ! ! - Don't use ping -w 1 in freebsd client script. ! ! - Token ring support for LPF, contributed by Andrew Chittenden. ! ! - Fix a subtle bug that would cause the server to respond incorrectly ! in some cases when the client sent duplicate DHCPREQUEST packets. ! ! - Fix option pretty printing for 'X' format. ! ! - Add some special cases to deal with DHCPREQUEST packets from RFC1541 ! clients. ! ! - Fix an obscure bug in nested subnet mask handling. ! ! - Fix a bug in abandoned lease reclamation. ! ! - Allow maximum message size to be set in configuration file. ! ! - Allow parameter request list to be supplied in configuration file. CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 26 diff -rNc2 dhcp-2.0b1pl27/TODO dhcp-2.0/TODO *** dhcp-2.0b1pl27/TODO Wed Nov 25 08:28:00 1998 --- dhcp-2.0/TODO Wed Dec 31 16:00:00 1969 *************** *** 1,31 **** - Things to do, not in any particular order... - - - Dynamic DNS support - - - SNMP support - - - Asynchronous DNS support (look up names while serving other requests) - - - Authentication heirarchies (particularly by MAC address or by DHCP - Authentication Protocol key). - - - Authentication protocol - - - 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? - - - Standard socket API for sending to all-ones broadcast and figuring - out which interface a packet came in on? - - - IPv6/DHCPv6 support - - - Dhcpd running on MacOS Open Transport - - - Dhcpd running on Windows/NT - - - Dhcpd running on Windows95 --- 0 ---- diff -rNc2 dhcp-2.0b1pl27/client/Makefile.dist dhcp-2.0/client/Makefile.dist *** dhcp-2.0b1pl27/client/Makefile.dist Sat Apr 24 09:45:49 1999 --- dhcp-2.0/client/Makefile.dist Sun May 9 09:09:22 1999 *************** *** 90,94 **** dhclient.cat8: dhclient.man8 ! nroff -man dhclient.man8 >dhclient.man8 dhclient.man8: dhclient.8 --- 90,94 ---- dhclient.cat8: dhclient.man8 ! nroff -man dhclient.man8 >dhclient.cat8 dhclient.man8: dhclient.8 *************** *** 124,125 **** --- 124,136 ---- # Dependencies (semi-automatically-generated) + + dhclient.o: dhclient.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h ../includes/version.h + clparse.o: clparse.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h ../includes/dhctoken.h diff -rNc2 dhcp-2.0b1pl27/client/dhclient-script.8 dhcp-2.0/client/dhclient-script.8 *** dhcp-2.0b1pl27/client/dhclient-script.8 Mon Mar 29 14:05:33 1999 --- dhcp-2.0/client/dhclient-script.8 Thu May 6 14:53:39 1999 *************** *** 62,66 **** file. If you find that you can't make such a customization without customizing ! .B ETCDIR/dhclient.conf or using the enter and exit hooks, please submit a bug report. .SH HOOKS --- 62,66 ---- file. If you find that you can't make such a customization without customizing ! .B dhclient-script or using the enter and exit hooks, please submit a bug report. .SH HOOKS diff -rNc2 dhcp-2.0b1pl27/client/dhclient-script.cat8 dhcp-2.0/client/dhclient-script.cat8 *** dhcp-2.0b1pl27/client/dhclient-script.cat8 Sat Feb 27 13:41:51 1999 --- dhcp-2.0/client/dhclient-script.cat8 Sun May 9 09:12:10 1999 *************** *** 2,6 **** ! dhclient(8) dhclient(8) --- 2,6 ---- ! dhclient-script(8) dhclient-script(8) *************** *** 20,46 **** This script is not meant to be customized by the end user. ! However, the script may not work on particular versions of ! particular operating systems (indeed, no standard script ! exists for some operating systems), so a pioneering user ! may well need to create a new script or modify an existing ! one. In general, customizations specific to a particular ! 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 ! When dhclient needs to invoke the client configuration script, it writes a shell script into /tmp which defines a variety of variables. In all cases, $reason is set to the ! name of the reason why the script has been invoked. The ! following reasons are currently defined: MEDIUM, PREINIT, ! ARPCHECK, ARPSEND, BOUND, RENEW, REBIND, REBOOT, EXPIRE, FAIL and TIMEOUT. MMEEDDIIUUMM ! The DHCP client is requesting that an interface's media ! type be set. The interface name is passed in $interface, and the media type is passed in $medium. --- 20,90 ---- This script is not meant to be customized by the end user. ! If local customizations are needed, they should be possi­ ! ble using the enter and exit hooks provided (see HOOKS for ! details). These hooks will allow the user to override ! the default behaviour of the client in creating a ! //eettcc//rreessoollvv..ccoonnff file. ! ! No standard client script exists for some operating sys­ ! tems, even though the actual client may work, so a pio­ ! neering user may well need to create a new script or mod­ ! ify an existing one. In general, customizations specific ! to a particular computer should be done in the ! //eettcc//ddhhcclliieenntt..ccoonnff file. If you find that you can't make ! such a customization without customizing ddhhcclliieenntt--ssccrriipptt ! or using the enter and exit hooks, please submit a bug report. + HHOOOOKKSS + When it starts, the client script first defines a shell + function, mmaakkee__rreessoollvv__ccoonnff ,, which is later used to create + the //eettcc//rreessoollvv..ccoonnff file. To override the default + behaviour, redefine this function in the enter hook + script. + + On after defining the make_resolv_conf function, the + client script checks for the presence of an executable + //eettcc//ddhhcclliieenntt--eenntteerr--hhooookkss script, and if present, it + invokes the script inline, using the Bourne shell '.' com­ + mand. The entire environment documented under OPERATION + is available to this script, which may modify the environ­ + ment if needed to change the behaviour of the script. If + an error occurs during the execution of the script, it can + set the exit_status variable to a nonzero value, and + //eettcc//ddhhcclliieenntt--ssccrriipptt will exit with that error code imme­ + diately after the client script exits. + + After all processing has completed, //eettcc//ddhhcclliieenntt--ssccrriipptt + checks for the presence of an executable //eettcc//ddhhcclliieenntt-- + eexxiitt--hhooookkss script, which if present is invoked using the + '.' command. The exit status is passed in the + + + + 1 + + + + + + dhclient-script(8) dhclient-script(8) + + + exit_status shell variable, and will always be zero if the + script succeeded at the task for which it was invoked. + OOPPEERRAATTIIOONN ! When dhclient needs to invoke the client configuration script, it writes a shell script into /tmp which defines a variety of variables. In all cases, $reason is set to the ! name of the reason why the script has been invoked. The ! following reasons are currently defined: MEDIUM, PREINIT, ! ARPCHECK, ARPSEND, BOUND, RENEW, REBIND, REBOOT, EXPIRE, FAIL and TIMEOUT. MMEEDDIIUUMM ! The DHCP client is requesting that an interface's media ! type be set. The interface name is passed in $interface, and the media type is passed in $medium. *************** *** 48,223 **** The DHCP client is requesting that an interface be config­ ured as required in order to send packets prior to receiv­ ! ing an actual address. For clients which use the BSD ! socket library, this means configuring the interface with ! an IP address of 0.0.0.0 and a broadcast address of ! 255.255.255.255. For other clients, it may be possible to simply configure the interface up without actually giv­ ! ing it an IP address at all. The interface name is passed in $interface, and the media type in $medium. ! If an IP alias has been declared in dhclient.conf, its ! address will be passed in $alias_ip_address, and that ip alias should be deleted from the interface, along with any ! 1 - dhclient(8) dhclient(8) - routes to it. ! AARRPPSSEENNDD ! The DHCP client is requesting that an address that has ! been offered to it be checked to see if somebody else is ! using it, by sending an ARP request for that address. ! It's not clear how to implement this, so no examples exist ! yet. The IP address to check is passed in ! $new_ip_address, and the interface name is passed in ! $interface. - 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 - and should be declined. $new_ip_address and $interface - are set as with ARPSEND. ! BBOOUUNNDD ! The DHCP client has done an initial binding to a new ! address. The new ip address is passed in ! $new_ip_address, and the interface name is passed in ! $interface. The media type is passed in $medium. Any ! options acquired from the server are passed using the ! option name described in ddhhccpp--ooppttiioonnss, except that dashes ! ('-') are replaced by underscores ('_') in order to make ! valid shell variables, and the variable names start with ! new_. So for example, the new subnet mask would be passed in $new_subnet_mask. When a binding has been completed, a lot of network param­ ! eters are likely to need to be set up. A new ! /etc/resolv.conf needs to be created, using the values of ! $new_domain_name and $new_domain_name_servers (which may ! list more than one server, seperated by spaces). A default route should be set using $new_routers, and static routes may need to be set up using $new_static_routes. ! If an IP alias has been declared, it must be set up here. The alias IP address will be written as $alias_ip_address, ! and other DHCP options that are set for the alias (e.g., ! subnet mask) will be passed in variables named as ! described previously except starting with $alias_ instead of $new_. Care should be taken that the alias IP address ! not be used if it is identical to the bound IP address ($new_ip_address), since the other alias parameters may be incorrect in this case. RREENNEEWW ! When a binding has been renewed, the script is called as ! in BOUND, except that in addition to all the variables ! starting with $new_, there is another set of variables ! starting with $old_. Persistent settings that may have ! ! ! ! 2 ! ! ! ! ! ! dhclient(8) dhclient(8) ! ! 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 static routes have changed, the old ones should be deleted. Otherwise, processing can be done as with BOUND. RREEBBIINNDD ! The DHCP client has rebound to a new DHCP server. This ! can be handled as with RENEW, except that if the IP address has changed, the ARP table should be cleared. RREEBBOOOOTT The DHCP client has successfully reacquired its old ! address after a reboot. This can be processed as with BOUND. EEXXPPIIRREE The DHCP client has failed to renew its lease or acquire a ! new one, and the lease has expired. The IP address must ! be relinquished, and all related parameters should be deleted, as in RENEW and REBIND. - FFAAIILL - The DHCP client has been unable to contact any DHCP - servers, and any leases that have been tested have not - proved to be valid. The parameters from the last lease - tested should be deconfigured. This can be handled in - the same way as EXPIRE. - - TTIIMMEEOOUUTT - The DHCP client has been unable to contact any DHCP - servers. However, an old lease has been identified, and - its parameters have been passed in as with BOUND. The - client configuration script should test these parameters - and, if it has reason to believe they are valid, should - exit with a value of zero. If not, it should exit with a - nonzero value. - The usual way to test a lease is to set up the network as - with REBIND (since this may be called to test more than - one lease) and then ping the first router defined in - $routers. If a response is received, the lease must be - valid for the network to which the interface is currently - connected. It would be more complete to try to ping all - of the routers listed in $new_routers, as well as those - listed in $new_static_routes, but current scripts do not - do this. ! FFIILLEESS ! Each operating system should generally have its own script ! 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 - 3 ! dhclient(8) dhclient(8) ! 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 If more than one interface is being used, there's no obvi­ ! ous way to avoid clashes between server-supplied configu­ ration parameters - for example, the stock dhclient-script rewrites /etc/resolv.conf. If more than one interface is being configured, /etc/resolv.conf will be repeatedly ini­ ! tialized to the values provided by one server, and then ! the other. Assuming the information provided by both ! servers is valid, this shouldn't cause any real problems, but it could be confusing. SSEEEE AALLSSOO ! dhclient(8), dhcpd(8), dhcrelay(8), dhclient.conf(5) and dhclient.leases(5). --- 92,254 ---- The DHCP client is requesting that an interface be config­ ured as required in order to send packets prior to receiv­ ! ing an actual address. For clients which use the BSD ! socket library, this means configuring the interface with ! an IP address of 0.0.0.0 and a broadcast address of ! 255.255.255.255. For other clients, it may be possible to simply configure the interface up without actually giv­ ! ing it an IP address at all. The interface name is passed in $interface, and the media type in $medium. ! If an IP alias has been declared in dhclient.conf, its ! address will be passed in $alias_ip_address, and that ip alias should be deleted from the interface, along with any + routes to it. + AARRPPSSEENNDD + The DHCP client is requesting that an address that has + been offered to it be checked to see if somebody else is + using it, by sending an ARP request for that address. + It's not clear how to implement this, so no examples exist + yet. The IP address to check is passed in + $new_ip_address, and the interface name is passed in + $interface. + 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 + and should be declined. $new_ip_address and $interface + are set as with ARPSEND. ! BBOOUUNNDD ! The DHCP client has done an initial binding to a new ! address. The new ip address is passed in + 2 ! dhclient-script(8) dhclient-script(8) ! $new_ip_address, and the interface name is passed in ! $interface. The media type is passed in $medium. Any ! options acquired from the server are passed using the ! option name described in ddhhccpp--ooppttiioonnss, except that dashes ! ('-') are replaced by underscores ('_') in order to make ! valid shell variables, and the variable names start with ! new_. So for example, the new subnet mask would be passed in $new_subnet_mask. When a binding has been completed, a lot of network param­ ! eters are likely to need to be set up. A new ! /etc/resolv.conf needs to be created, using the values of ! $new_domain_name and $new_domain_name_servers (which may ! list more than one server, seperated by spaces). A default route should be set using $new_routers, and static routes may need to be set up using $new_static_routes. ! If an IP alias has been declared, it must be set up here. The alias IP address will be written as $alias_ip_address, ! and other DHCP options that are set for the alias (e.g., ! subnet mask) will be passed in variables named as ! described previously except starting with $alias_ instead of $new_. Care should be taken that the alias IP address ! not be used if it is identical to the bound IP address ($new_ip_address), since the other alias parameters may be incorrect in this case. RREENNEEWW ! When a binding has been renewed, the script is called as ! in BOUND, except that in addition to all the variables ! 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 route should be deleted. If the default route has ! changed, the old default route should be deleted. If the static routes have changed, the old ones should be deleted. Otherwise, processing can be done as with BOUND. RREEBBIINNDD ! The DHCP client has rebound to a new DHCP server. This ! can be handled as with RENEW, except that if the IP address has changed, the ARP table should be cleared. RREEBBOOOOTT The DHCP client has successfully reacquired its old ! address after a reboot. This can be processed as with BOUND. EEXXPPIIRREE The DHCP client has failed to renew its lease or acquire a ! new one, and the lease has expired. The IP address must ! be relinquished, and all related parameters should be deleted, as in RENEW and REBIND. ! 3 + dhclient-script(8) dhclient-script(8) + FFAAIILL + The DHCP client has been unable to contact any DHCP + servers, and any leases that have been tested have not + proved to be valid. The parameters from the last lease + tested should be deconfigured. This can be handled in + the same way as EXPIRE. ! TTIIMMEEOOUUTT ! The DHCP client has been unable to contact any DHCP ! servers. However, an old lease has been identified, and ! its parameters have been passed in as with BOUND. The ! client configuration script should test these parameters ! and, if it has reason to believe they are valid, should ! exit with a value of zero. If not, it should exit with a ! nonzero value. + The usual way to test a lease is to set up the network as + with REBIND (since this may be called to test more than + one lease) and then ping the first router defined in + $routers. If a response is received, the lease must be + valid for the network to which the interface is currently + connected. It would be more complete to try to ping all + of the routers listed in $new_routers, as well as those + listed in $new_static_routes, but current scripts do not + do this. ! FFIILLEESS ! Each operating system should generally have its own script ! 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 sys­ tems on which they are intended to work. BBUUGGSS If more than one interface is being used, there's no obvi­ ! ous way to avoid clashes between server-supplied configu­ ration parameters - for example, the stock dhclient-script rewrites /etc/resolv.conf. If more than one interface is being configured, /etc/resolv.conf will be repeatedly ini­ ! tialized to the values provided by one server, and then ! the other. Assuming the information provided by both ! servers is valid, this shouldn't cause any real problems, but it could be confusing. SSEEEE AALLSSOO ! dhclient(8), dhcpd(8), dhcrelay(8), dhclient.conf(5) and dhclient.leases(5). *************** *** 225,231 **** ddhhcclliieenntt--ssccrriipptt((88)) has been written for the Internet Soft­ ware Consortium by Ted Lemon in cooper­ ! ation with Vixie Enterprises. To learn more about the ! Internet Software Consortium, see hhttttpp::////wwwwww..vviixx..ccoomm//iisscc.. ! To learn more about Vixie Enterprises, see hhttttpp::////wwwwww..vviixx..ccoomm.. --- 256,274 ---- ddhhcclliieenntt--ssccrriipptt((88)) has been written for the Internet Soft­ ware Consortium by Ted Lemon in cooper­ ! ation with Vixie Enterprises. To learn more about the ! ! ! ! 4 ! ! ! ! ! ! dhclient-script(8) dhclient-script(8) ! ! ! Internet Software Consortium, see hhttttpp::////wwwwww..vviixx..ccoomm//iisscc.. ! To learn more about Vixie Enterprises, see hhttttpp::////wwwwww..vviixx..ccoomm.. *************** *** 260,264 **** ! 4 --- 303,330 ---- ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! 5 diff -rNc2 dhcp-2.0b1pl27/client/dhclient.c dhcp-2.0/client/dhclient.c *** dhcp-2.0b1pl27/client/dhclient.c Sat Apr 24 09:55:19 1999 --- dhcp-2.0/client/dhclient.c Tue Jun 22 06:36:46 1999 *************** *** 57,64 **** #ifndef lint static char ocopyright[] = ! "$Id: dhclient.c,v 1.44.2.37 1999/04/24 16:55:19 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" TIME cur_time; --- 57,65 ---- #ifndef lint static char ocopyright[] = ! "$Id: dhclient.c,v 1.44.2.39 1999/06/22 13:36:46 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" + #include "version.h" TIME cur_time; *************** *** 93,97 **** "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.0b1pl27"; static char contrib [] = "Please contribute if you find this software useful."; static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html"; --- 94,98 ---- "Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium."; static char arr [] = "All rights reserved."; ! static char message [] = "Internet Software Consortium DHCP Client"; static char contrib [] = "Please contribute if you find this software useful."; static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html"; *************** *** 110,114 **** char *s; ! s = strchr (argv [0], '/'); if (!s) s = argv [0]; --- 111,115 ---- char *s; ! s = strrchr (argv [0], '/'); if (!s) s = argv [0]; *************** *** 169,173 **** if (!quiet) { ! note (message); note (copyright); note (arr); --- 170,174 ---- if (!quiet) { ! note ("%s %s", message, DHCP_VERSION); note (copyright); note (arr); diff -rNc2 dhcp-2.0b1pl27/client/dhclient.cat8 dhcp-2.0/client/dhclient.cat8 *** dhcp-2.0b1pl27/client/dhclient.cat8 Fri Nov 21 23:51:02 1997 --- dhcp-2.0/client/dhclient.cat8 Sun May 9 09:12:10 1999 *************** *** 97,100 **** --- 97,109 ---- should be followed by the udp port number that dhclient should use. This is mostly useful for debugging purposes. + If the --pp 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 --pp 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 --pp 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. Dhclient will normally run in the foreground until it has *************** *** 116,128 **** SSEEEE AALLSSOO dhcpd(8), dhcrelay(8), dhclient.conf(5), - dhclient.leases(5) - - AAUUTTHHOORR - ddhhcclliieenntt((88)) 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 hhttttpp::////wwwwww..vviixx..ccoomm//iisscc.. To learn - more about Vixie Enterprises, see hhttttpp::////wwwwww..vviixx..ccoomm.. - --- 125,128 ---- *************** *** 137,140 **** --- 137,149 ---- + dhclient.leases(5) + + AAUUTTHHOORR + ddhhcclliieenntt((88)) 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 hhttttpp::////wwwwww..vviixx..ccoomm//iisscc.. To learn + more about Vixie Enterprises, see hhttttpp::////wwwwww..vviixx..ccoomm.. + This client was substantially modified and enhanced by Elliot Poger for use on Linux while he was working on the *************** *** 151,163 **** these operating systems - instead, the shell script can invoke the native tools to accomplish the same purpose. - - - - - - - - - --- 160,163 ---- diff -rNc2 dhcp-2.0b1pl27/client/dhclient.conf.cat5 dhcp-2.0/client/dhclient.conf.cat5 *** dhcp-2.0b1pl27/client/dhclient.conf.cat5 Fri Nov 21 23:10:40 1997 --- dhcp-2.0/client/dhclient.conf.cat5 Sun May 9 09:12:10 1999 *************** *** 244,252 **** _t_i_o_n ]}} ! If for some set of options the client should first a value ! it supplies, and then use the values supplied by the server, if any, these values can be defined in the pprreeppeenndd statement. The pprreeppeenndd statement can only be used for ! options which allow more than one value to be given. _T_h_e aappppeenndd _s_t_a_t_e_m_e_n_t --- 244,254 ---- _t_i_o_n ]}} ! If for some set of options the client should use a value ! you supply, and then use the values supplied by the server, if any, these values can be defined in the pprreeppeenndd statement. The pprreeppeenndd statement can only be used for ! options which allow more than one value to be given. ! This restriction is not enforced - if violated, the ! results are unpredictable. _T_h_e aappppeenndd _s_t_a_t_e_m_e_n_t *************** *** 255,260 **** ]}} - If for some set of options the client should first a value - it supplies, and then use the values supplied by the --- 257,260 ---- *************** *** 269,275 **** ! server, if any, these values can be defined in the aappppeenndd statement. The aappppeenndd statement can only be used for ! options which allow more than one value to be given. LLEEAASSEE DDEECCLLAARRAATTIIOONNSS --- 269,279 ---- ! If for some set of options the client should first use the ! values supplied by the server, if any, and then use values ! you supply, these values can be defined in the aappppeenndd statement. The aappppeenndd statement can only be used for ! options which allow more than one value to be given. ! This restriction is not enforced - if you ignore it, the ! behaviour will be unpredictable. LLEEAASSEE DDEECCLLAARRAATTIIOONNSS *************** *** 320,327 **** fied, although this is not required. - ffiixxeedd--aaddddrreessss _i_p_-_a_d_d_r_e_s_s;; - - The ffiixxeedd--aaddddrreessss statement is used to set the ip address - --- 324,327 ---- *************** *** 335,338 **** --- 335,341 ---- + ffiixxeedd--aaddddrreessss _i_p_-_a_d_d_r_e_s_s;; + + The ffiixxeedd--aaddddrreessss statement is used to set the ip address of a particular lease. This is required for all lease statements. The IP address must be specified as a dotted *************** *** 386,392 **** it used a media type (see the mmeeddiiaa statement) when con­ figuring the interface in order to obtain a lease. This - statement should be used in predefined leases only if the - network interface requires media type configuration. - --- 389,392 ---- *************** *** 401,404 **** --- 401,407 ---- + statement should be used in predefined leases only if the + network interface requires media type configuration. + rreenneeww _d_a_t_e;; *************** *** 452,458 **** The alias declaration resembles a lease declaration, except that options other than the subnet-mask option are - ignored by the standard client configuration script, and - expiry times are ignored. A typical alias declaration - includes an interface declaration, a fixed-address --- 455,458 ---- *************** *** 467,473 **** ! declaration for the IP alias address, and a subnet-mask ! option declaration. A medium statement should never be ! included in an alias declaration. OOTTHHEERR DDEECCLLAARRAATTIIOONNSS --- 467,476 ---- ! ignored by the standard client configuration script, and ! expiry times are ignored. A typical alias declaration ! includes an interface declaration, a fixed-address decla­ ! ration for the IP alias address, and a subnet-mask option ! declaration. A medium statement should never be included ! in an alias declaration. OOTTHHEERR DDEECCLLAARRAATTIIOONNSS *************** *** 518,524 **** The following configuration file is used on a laptop run­ ning NetBSD 1.3. The laptop has an IP alias of - 192.5.5.213, and has one interface, ep0 (a 3com 3C589C). - Booting intervals have been shortened somewhat from the - default, because the client is known to spend most of its --- 521,524 ---- *************** *** 533,536 **** --- 533,539 ---- + 192.5.5.213, and has one interface, ep0 (a 3com 3C589C). + Booting intervals have been shortened somewhat from the + default, because the client is known to spend most of its time on networks with little DHCP activity. The laptop does roam to multiple networks. *************** *** 577,583 **** Information about the Internet Software Consortium can be found at hhttttpp::////wwwwww..iisscc..oorrgg//iisscc.. - - - --- 580,583 ---- diff -rNc2 dhcp-2.0b1pl27/client/scripts/freebsd dhcp-2.0/client/scripts/freebsd *** dhcp-2.0b1pl27/client/scripts/freebsd Mon Mar 29 13:51:53 1999 --- dhcp-2.0/client/scripts/freebsd Thu May 6 14:52:52 1999 *************** *** 159,163 **** if [ "$new_routers" != "" ]; then set $new_routers ! 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 ---- if [ "$new_routers" != "" ]; then set $new_routers ! if ping -q -c 1 $1; then if [ x$new_ip_address != x$alias_ip_address ] && \ [ x$alias_ip_address != x ]; then diff -rNc2 dhcp-2.0b1pl27/common/Makefile.dist dhcp-2.0/common/Makefile.dist *** dhcp-2.0b1pl27/common/Makefile.dist Sat Apr 24 09:45:49 1999 --- dhcp-2.0/common/Makefile.dist Thu May 27 10:44:51 1999 *************** *** 35,42 **** 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 --- 35,44 ---- 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 \ ! tr.c ethernet.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 \ ! tr.o ethernet.o MAN = dhcp-options.5 *************** *** 84,85 **** --- 86,206 ---- # Dependencies (semi-automatically-generated) + + raw.o: raw.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + parse.o: parse.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h \ + ../includes/dhcp.h ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h ../includes/dhctoken.h + nit.o: nit.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + icmp.o: icmp.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h ../includes/netinet/ip.h \ + ../includes/netinet/ip_icmp.h + dispatch.o: dispatch.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h \ + conflex.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h ../includes/dhctoken.h + upf.o: upf.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + bpf.o: bpf.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h ../includes/netinet/ip.h ../includes/netinet/udp.h \ + ../includes/netinet/if_ether.h + socket.o: socket.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + lpf.o: lpf.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + packet.o: packet.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h ../includes/netinet/ip.h \ + ../includes/netinet/udp.h ../includes/netinet/if_ether.h + memory.o: memory.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + print.o: print.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + options.o: options.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + inet.o: inet.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + convert.o: convert.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + tree.o: tree.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + tables.o: tables.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + hash.o: hash.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + alloc.o: alloc.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + errwarn.o: errwarn.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + inet_addr.o: inet_addr.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + dlpi.o: dlpi.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h diff -rNc2 dhcp-2.0b1pl27/common/bpf.c dhcp-2.0/common/bpf.c *** dhcp-2.0b1pl27/common/bpf.c Mon Mar 29 14:07:12 1999 --- dhcp-2.0/common/bpf.c Thu May 27 10:44:51 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: bpf.c,v 1.19.2.9 1999/03/29 22:07:12 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: bpf.c,v 1.19.2.10 1999/05/27 17:44:51 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 187,190 **** --- 187,204 ---- int dhcp_bpf_filter_len = sizeof dhcp_bpf_filter / sizeof (struct bpf_insn); + + struct bpf_insn dhcp_bpf_tr_filter [] = { + /* accept all token ring packets due to variable length header */ + /* if we want to get clever, insert the program here */ + + /* If we passed all the tests, ask for the whole packet. */ + BPF_STMT(BPF_RET+BPF_K, (u_int)-1), + + /* Otherwise, drop it. */ + BPF_STMT(BPF_RET+BPF_K, 0), + }; + + int dhcp_bpf_tr_filter_len = (sizeof dhcp_bpf_tr_filter / + sizeof (struct bpf_insn)); #endif diff -rNc2 dhcp-2.0b1pl27/common/dhcp-options.cat5 dhcp-2.0/common/dhcp-options.cat5 *** dhcp-2.0b1pl27/common/dhcp-options.cat5 Fri Feb 5 12:55:39 1999 --- dhcp-2.0/common/dhcp-options.cat5 Sun May 9 09:12:11 1999 *************** *** 56,62 **** ple: ! option client-identifier "CLIENT-FOO"; or ! option client-identifier 43:4c:49:45:54:2d:46:4f:4f; --- 56,62 ---- ple: ! option dhcp-client-identifier "CLIENT-FOO"; or ! option dhcp-client-identifier 43:4c:49:45:54:2d:46:4f:4f; *************** *** 519,523 **** find the host record by matching against the client identifier. ! --- 519,523 ---- find the host record by matching against the client identifier. ! ooppttiioonn nniisspplluuss--ddoommaaiinn _s_t_r_i_n_g;; *************** *** 533,561 **** ! 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.. --- 533,594 ---- ! This option specifies the name of the client's NIS+ ! domain. The domain is formatted as a character string ! consisting of characters from the NVT ASCII character ! set. ! ooppttiioonn nniisspplluuss--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 ttffttpp--sseerrvveerr--nnaammee _s_t_r_i_n_g;; + This option is used to identify a TFTP server and, if + supported by the client, should have the same effect as + the sseerrvveerr--nnaammee declaration. BOOTP clients are + unlikely to support this option. Some DHCP clients + will support it, and others actually require it. + + ooppttiioonn bboooottffiillee--nnaammee _s_t_r_i_n_g;; + + This option is used to identify a bootstrap file. If + supported by the client, it should have the same effect + as the ffiilleennaammee declaration. BOOTP clients are + unlikely to support this option. Some DHCP clients + will support it, and others actually require it. + ooppttiioonn mmoobbiillee--iipp--hhoommee--aaggeenntt _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 + mobile IP home agents available to the client. Agents + should be listed in order of preference, although nor­ + mally there will be only one such agent. + ooppttiioonn ssmmttpp--sseerrvveerr _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; + The SMTP server option specifies a list of SMTP servers + available to the client. Servers should be listed in + order of preference. + ooppttiioonn ppoopp--sseerrvveerr _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; + The POP3 server option specifies a list of POP3 avail­ + able to the client. Servers should be listed in order + of preference. + ooppttiioonn nnnnttpp--sseerrvveerr _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; + The NNTP server option specifies a list of NNTP avail­ + able to the client. Servers should be listed in order + of preference. + ooppttiioonn wwwwww--sseerrvveerr _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; + The WWW server option specifies a list of WWW available + 9 *************** *** 563,575 **** --- 596,641 ---- + dhcpd-options(5) dhcpd-options(5) + to the client. Servers should be listed in order of + preference. + ooppttiioonn ffiinnggeerr--sseerrvveerr _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; + The Finger server option specifies a list of Finger + available to the client. Servers should be listed in + order of preference. + + ooppttiioonn iirrcc--sseerrvveerr _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; + The IRC server option specifies a list of IRC available + to the client. Servers should be listed in order of + preference. + + ooppttiioonn ssttrreeeettttaallkk--sseerrvveerr _i_p_-_a_d_d_r_e_s_s [,, _i_p_-_a_d_d_r_e_s_s... ];; + + The StreetTalk server option specifies a list of + StreetTalk servers available to the client. Servers + should be listed in order of preference. + ooppttiioonn ssttrreeeettaallkk--ddiirreeccttoorryy--aassssiissttaannccee--sseerrvveerr _i_p_-_a_d_d_r_e_s_s [,, + _i_p_-_a_d_d_r_e_s_s... ];; + The StreetTalk Directory Assistance (STDA) server + option specifies a list of STDA servers available to + the client. Servers should be listed in order of pref­ + erence. + 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.. *************** *** 590,594 **** ! 9 --- 656,660 ---- ! 10 diff -rNc2 dhcp-2.0b1pl27/common/dlpi.c dhcp-2.0/common/dlpi.c *** dhcp-2.0b1pl27/common/dlpi.c Sat Apr 24 09:48:10 1999 --- dhcp-2.0/common/dlpi.c Sat May 8 11:12:27 1999 *************** *** 85,89 **** #ifndef lint static char copyright[] = ! "$Id: dlpi.c,v 1.2.2.7 1999/04/24 16:48:10 mellon Exp $ Copyright (c) 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 85,89 ---- #ifndef lint static char copyright[] = ! "$Id: dlpi.c,v 1.2.2.8 1999/05/08 18:12:27 mellon Exp $ Copyright (c) 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 227,230 **** --- 227,234 ---- case DL_ETHER: info -> hw_address.htype = HTYPE_ETHER; + break; + /* adding token ring 5/1999 - mayer@ping.at */ + case DL_TPR: + info -> hw_address.htype = HTYPE_IEEE802; break; case DL_FDDI: diff -rNc2 dhcp-2.0b1pl27/common/ethernet.c dhcp-2.0/common/ethernet.c *** dhcp-2.0b1pl27/common/ethernet.c Wed Dec 31 16:00:00 1969 --- dhcp-2.0/common/ethernet.c Thu May 27 10:35:47 1999 *************** *** 0 **** --- 1,110 ---- + /* packet.c + + Packet assembly code, originally contributed by Archie Cobbs. */ + + /* + * Copyright (c) 1995, 1996 The Internet Software Consortium. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of The Internet Software Consortium nor the names + * of its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND + * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL 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: ethernet.c,v 1.1.2.1 1999/05/27 17:35:47 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; + #endif /* not lint */ + + #include "dhcpd.h" + + #if defined (PACKET_ASSEMBLY) || defined (PACKET_DECODING) + #include "includes/netinet/if_ether.h" + #endif /* PACKET_ASSEMBLY || PACKET_DECODING */ + + #if defined (PACKET_ASSEMBLY) + /* Assemble an hardware header... */ + /* XXX currently only supports ethernet; doesn't check for other types. */ + + void assemble_ethernet_header (interface, buf, bufix, to) + struct interface_info *interface; + unsigned char *buf; + int *bufix; + struct hardware *to; + { + struct ether_header eh; + + if (to && to -> hlen == 6) /* XXX */ + memcpy (eh.ether_dhost, to -> haddr, sizeof eh.ether_dhost); + else + memset (eh.ether_dhost, 0xff, sizeof (eh.ether_dhost)); + if (interface -> hw_address.hlen == sizeof (eh.ether_shost)) + memcpy (eh.ether_shost, interface -> hw_address.haddr, + sizeof (eh.ether_shost)); + else + memset (eh.ether_shost, 0x00, sizeof (eh.ether_shost)); + + #ifdef BROKEN_FREEBSD_BPF /* Fixed in FreeBSD 2.2 */ + eh.ether_type = ETHERTYPE_IP; + #else + eh.ether_type = htons (ETHERTYPE_IP); + #endif + + memcpy (&buf [*bufix], &eh, sizeof eh); + *bufix += sizeof eh; + } + #endif /* PACKET_ASSEMBLY */ + + #ifdef PACKET_DECODING + /* Decode a hardware header... */ + + ssize_t decode_ethernet_header (interface, buf, bufix, from) + struct interface_info *interface; + unsigned char *buf; + int bufix; + struct hardware *from; + { + struct ether_header eh; + + memcpy (&eh, buf + bufix, sizeof eh); + + #ifdef USERLAND_FILTER + if (ntohs (eh.ether_type) != ETHERTYPE_IP) + return -1; + #endif + memcpy (from -> haddr, eh.ether_shost, sizeof (eh.ether_shost)); + from -> htype = ARPHRD_ETHER; + from -> hlen = sizeof eh.ether_shost; + + return sizeof eh; + } + #endif /* PACKET_DECODING */ diff -rNc2 dhcp-2.0b1pl27/common/lpf.c dhcp-2.0/common/lpf.c *** dhcp-2.0b1pl27/common/lpf.c Mon Mar 29 14:07:13 1999 --- dhcp-2.0/common/lpf.c Thu May 27 10:44:52 1999 *************** *** 44,48 **** #ifndef lint static char copyright[] = ! "$Id: lpf.c,v 1.1.2.8 1999/03/29 22:07:13 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 44,48 ---- #ifndef lint static char copyright[] = ! "$Id: lpf.c,v 1.1.2.9 1999/05/27 17:44:52 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 60,63 **** --- 60,66 ---- #include "includes/netinet/if_ether.h" + static void lpf_gen_filter_setup PROTO ((struct interface_info *)); + static void lpf_tr_filter_setup PROTO ((struct interface_info *)); + /* Reinitializes the specified interface after an address change. This is not required for packet-filter APIs. */ *************** *** 150,162 **** 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 */ --- 153,186 ---- extern struct sock_filter dhcp_bpf_filter []; extern int dhcp_bpf_filter_len; + extern struct sock_filter dhcp_bpf_tr_filter []; + extern int dhcp_bpf_tr_filter_len; void if_register_receive (info) struct interface_info *info; { /* Open a LPF device and hang it on this interface... */ info -> rfdesc = if_register_lpf (info); + if (info -> hw_address.htype == HTYPE_IEEE802) + lpf_tr_filter_setup (info); + else + lpf_gen_filter_setup (info); + + 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 : "")); + } + + static void lpf_gen_filter_setup (info) + struct interface_info *info; + { + struct sock_fprog p; + /* Set up the bpf filter program structure. This is defined in bpf.c */ *************** *** 179,191 **** 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 */ --- 203,235 ---- error ("Can't install packet filter program: %m"); } ! } ! ! static void lpf_tr_filter_setup (info) ! struct interface_info *info; ! { ! struct sock_fprog p; ! ! /* Set up the bpf filter program structure. This is defined in ! bpf.c */ ! p.len = dhcp_bpf_tr_filter_len; ! p.filter = dhcp_bpf_tr_filter; ! ! /* Patch the server port into the LPF program... ! XXX changes to filter program may require changes ! XXX to the insn number(s) used below! ! XXX Token ring filter is null - when/if we have a filter ! XXX that's not, we'll need this code. ! XXX dhcp_bpf_filter [?].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"); ! } } #endif /* USE_LPF_RECEIVE */ diff -rNc2 dhcp-2.0b1pl27/common/memory.c dhcp-2.0/common/memory.c *** dhcp-2.0b1pl27/common/memory.c Tue Nov 24 14:32:43 1998 --- dhcp-2.0/common/memory.c Thu May 27 10:47:43 1999 *************** *** 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 */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: memory.c,v 1.35.2.4 1999/05/27 17:47:43 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 528,532 **** /* Copy the data files, but not the linkages. */ comp -> starts = lease -> starts; - comp -> timestamp = lease -> timestamp; if (lease -> uid) { if (lease -> uid_len < sizeof (lease -> uid_buf)) { --- 528,531 ---- diff -rNc2 dhcp-2.0b1pl27/common/options.c dhcp-2.0/common/options.c *** dhcp-2.0b1pl27/common/options.c Mon Mar 29 18:57:47 1999 --- dhcp-2.0/common/options.c Thu May 6 14:54:34 1999 *************** *** 43,51 **** #ifndef lint static char copyright[] = ! "$Id: options.c,v 1.26.2.7 1999/03/30 02:57:47 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #define DHCP_OPTION_DATA #include "dhcpd.h" /* Parse all available options out of the specified packet. */ --- 43,52 ---- #ifndef lint static char copyright[] = ! "$Id: options.c,v 1.26.2.10 1999/05/06 21:54:34 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #define DHCP_OPTION_DATA #include "dhcpd.h" + #include /* Parse all available options out of the specified packet. */ *************** *** 440,444 **** int numelem = 0; char fmtbuf [32]; ! int i, j; char *op = optbuf; unsigned char *dp = data; --- 441,445 ---- int numelem = 0; char fmtbuf [32]; ! int i, j, k; char *op = optbuf; unsigned char *dp = data; *************** *** 472,480 **** break; case 'X': ! fmtbuf [i] = 'x'; fmtbuf [i + 1] = 0; - hunksize++; - numhunk = 0; - comma = ':'; break; case 't': --- 473,491 ---- break; case 'X': ! for (k = 0; k < len; k++) { ! if (!isascii (data [k]) || ! !isprint (data [k])) ! break; ! } ! if (k == len) { ! fmtbuf [i] = 't'; ! numhunk = -2; ! } else { ! fmtbuf [i] = 'x'; ! hunksize++; ! comma = ':'; ! numhunk = 0; ! } fmtbuf [i + 1] = 0; break; case 't': diff -rNc2 dhcp-2.0b1pl27/common/packet.c dhcp-2.0/common/packet.c *** dhcp-2.0b1pl27/common/packet.c Sat Apr 24 08:31:47 1999 --- dhcp-2.0/common/packet.c Wed Jun 9 17:58:16 1999 *************** *** 4,8 **** /* ! * Copyright (c) 1995, 1996 The Internet Software Consortium. * All rights reserved. * --- 4,8 ---- /* ! * Copyright (c) 1995, 1996, 1999 The Internet Software Consortium. * All rights reserved. * *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: packet.c,v 1.18.2.4 1999/04/24 15:31:47 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: packet.c,v 1.18.2.6 1999/06/10 00:58:16 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 51,55 **** #include "includes/netinet/ip.h" #include "includes/netinet/udp.h" - #include "includes/netinet/if_ether.h" #endif /* PACKET_ASSEMBLY || PACKET_DECODING */ --- 51,54 ---- *************** *** 123,146 **** struct hardware *to; { ! struct ether_header eh; ! ! if (to && to -> hlen == 6) /* XXX */ ! memcpy (eh.ether_dhost, to -> haddr, sizeof eh.ether_dhost); ! else ! memset (eh.ether_dhost, 0xff, sizeof (eh.ether_dhost)); ! if (interface -> hw_address.hlen == sizeof (eh.ether_shost)) ! memcpy (eh.ether_shost, interface -> hw_address.haddr, ! sizeof (eh.ether_shost)); else - memset (eh.ether_shost, 0x00, sizeof (eh.ether_shost)); - - #ifdef BROKEN_FREEBSD_BPF /* Fixed in FreeBSD 2.2 */ - eh.ether_type = ETHERTYPE_IP; - #else - eh.ether_type = htons (ETHERTYPE_IP); #endif - memcpy (&buf [*bufix], &eh, sizeof eh); - *bufix += sizeof eh; } --- 122,132 ---- struct hardware *to; { ! #if defined (HAVE_TR_SUPPORT) ! if (interface -> hw_address.htype == HTYPE_IEEE802) ! assemble_tr_header (interface, buf, bufix, to); else #endif + assemble_ethernet_header (interface, buf, bufix, to); } *************** *** 208,212 **** #ifdef PACKET_DECODING /* Decode a hardware header... */ - /* XXX currently only supports ethernet; doesn't check for other types. */ ssize_t decode_hw_header (interface, buf, bufix, from) --- 194,197 ---- *************** *** 216,232 **** struct hardware *from; { ! struct ether_header eh; ! ! memcpy (&eh, buf + bufix, sizeof eh); ! ! #ifdef USERLAND_FILTER ! if (ntohs (eh.ether_type) != ETHERTYPE_IP) ! return -1; #endif ! memcpy (from -> haddr, eh.ether_shost, sizeof (eh.ether_shost)); ! from -> htype = ARPHRD_ETHER; ! from -> hlen = sizeof eh.ether_shost; ! ! return sizeof eh; } --- 201,210 ---- struct hardware *from; { ! #if defined (HAVE_TR_SUPPORT) ! if (interface -> hw_address.htype == HTYPE_IEEE802) ! return decode_tr_header (interface, buf, bufix, from); ! else #endif ! return decode_ethernet_header (interface, buf, bufix, from); } diff -rNc2 dhcp-2.0b1pl27/common/tr.c dhcp-2.0/common/tr.c *** dhcp-2.0b1pl27/common/tr.c Wed Dec 31 16:00:00 1969 --- dhcp-2.0/common/tr.c Wed Jun 9 17:58:06 1999 *************** *** 0 **** --- 1,307 ---- + /* + * packet_tr.c - token ring interface code, contributed in May of 1999 + * by Andrew Chittenden + */ + + #include "dhcpd.h" + + #if defined (HAVE_TR_SUPPORT) && \ + (defined (PACKET_ASSEMBLY) || defined (PACKET_DECODING)) + #include "includes/netinet/ip.h" + #include "includes/netinet/udp.h" + #include "includes/netinet/if_ether.h" + #include "netinet/if_tr.h" + #include + + /* + * token ring device handling subroutines. These are required as token-ring + * does not have a simple on-the-wire header but requires the use of + * source routing + */ + + static int insert_source_routing PROTO ((struct trh_hdr *trh, struct interface_info* interface)); + static void save_source_routing PROTO ((struct trh_hdr *trh, struct interface_info* interface)); + static void expire_routes PROTO ((void)); + + /* + * As we keep a list of interesting routing information only, a singly + * linked list is all we need + */ + struct routing_entry { + struct routing_entry *next; + unsigned char addr[TR_ALEN]; + unsigned char iface[5]; + __u16 rcf; /* route control field */ + __u16 rseg[8]; /* routing registers */ + unsigned long access_time; /* time we last used this entry */ + }; + + static struct routing_entry *routing_info = NULL; + + static int routing_timeout = 10; + static struct timeval routing_timer; + + void assemble_tr_header (interface, buf, bufix, to) + struct interface_info *interface; + unsigned char *buf; + int *bufix; + struct hardware *to; + { + struct trh_hdr *trh; + int hdr_len; + struct trllc *llc; + + + /* set up the token header */ + trh = (struct trh_hdr *) &buf[*bufix]; + if (interface -> hw_address.hlen == sizeof (trh->saddr)) + memcpy (trh->saddr, interface -> hw_address.haddr, + sizeof (trh->saddr)); + else + memset (trh->saddr, 0x00, sizeof (trh->saddr)); + + if (to && to -> hlen == 6) /* XXX */ + memcpy (trh->daddr, to -> haddr, sizeof trh->daddr); + else + memset (trh->daddr, 0xff, sizeof (trh->daddr)); + + hdr_len = insert_source_routing (trh, interface); + + trh->ac = AC; + trh->fc = LLC_FRAME; + + /* set up the llc header for snap encoding after the tr header */ + llc = (struct trllc *)(buf + *bufix + hdr_len); + llc->dsap = EXTENDED_SAP; + llc->ssap = EXTENDED_SAP; + llc->llc = UI_CMD; + llc->protid[0] = 0; + llc->protid[1] = 0; + llc->protid[2] = 0; + llc->ethertype = htons(ETHERTYPE_IP); + + hdr_len += sizeof(struct trllc); + + *bufix += hdr_len; + } + + + static unsigned char tr_broadcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + + /* + * decoding the token header is a bit complex as you can see here. It is + * further complicated by the linux kernel stripping off some valuable + * information (see comment below) even though we've asked for the raw + * packets. + */ + ssize_t decode_tr_header (interface, buf, bufix, from) + struct interface_info *interface; + unsigned char *buf; + int bufix; + struct hardware *from; + { + struct trh_hdr *trh = (struct trh_hdr *) buf + bufix; + struct trllc *llc; + struct ip *ip; + struct udphdr *udp; + unsigned int route_len = 0; + ssize_t hdr_len; + struct timeval now; + + /* see whether any source routing information has expired */ + gettimeofday(&now, NULL); + + if (routing_timer.tv_sec == 0) + routing_timer.tv_sec = now.tv_sec + routing_timeout; + else if ((now.tv_sec - routing_timer.tv_sec) > 0) + expire_routes(); + + /* the kernel might have stripped off the source + * routing bit. We try a heuristic to determine whether + * this is the case and put it back on if so + */ + route_len = (ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8; + llc = (struct trllc *)(buf + bufix + sizeof(struct trh_hdr)-TR_MAXRIFLEN+route_len); + if (llc->dsap == EXTENDED_SAP + && llc->ssap == EXTENDED_SAP + && llc->llc == UI_CMD + && llc->protid[0] == 0 + && llc->protid[1] == 0 + && llc->protid[2] == 0) { + /* say there is source routing information present */ + trh->saddr[0] |= TR_RII; + } + + if (trh->saddr[0] & TR_RII) + route_len = (ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8; + else + route_len = 0; + + hdr_len = sizeof (struct trh_hdr) - TR_MAXRIFLEN + route_len; + + /* now filter out unwanted packets: this is based on the packet + * filter code in bpf.c */ + llc = (struct trllc *)(buf + bufix + hdr_len); + ip = (struct ip *) (llc + 1); + udp = (struct udphdr *) ((unsigned char*) ip + ip->ip_hl * 4); + + /* make sure it is a snap encoded, IP, UDP, unfragmented packet sent + * to our port */ + if (llc->dsap != EXTENDED_SAP + || ntohs(llc->ethertype) != ETHERTYPE_IP + || ip->ip_p != IPPROTO_UDP + || (ip->ip_off & IP_OFFMASK) != 0 + || udp->uh_dport != local_port) + return -1; + + /* only save source routing information for packets from valued hosts */ + save_source_routing(trh, interface); + + return hdr_len + sizeof (struct trllc); + } + + /* insert_source_routing inserts source route information into the token ring + * header + */ + static int insert_source_routing (trh, interface) + struct trh_hdr *trh; + struct interface_info* interface; + { + struct routing_entry *rover; + struct timeval now; + unsigned int route_len = 0; + + gettimeofday(&now, NULL); + + /* single route broadcasts as per rfc 1042 */ + if (memcmp(trh->daddr, tr_broadcast,TR_ALEN) == 0) { + trh->saddr[0] |= TR_RII; + trh->rcf = ((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK; + trh->rcf |= (TR_RCF_FRAME2K | TR_RCF_LIMITED_BROADCAST); + trh->rcf = htons(trh->rcf); + } else { + /* look for a routing entry */ + for (rover = routing_info; rover != NULL; rover = rover->next) { + if (memcmp(rover->addr, trh->daddr, TR_ALEN) == 0) + break; + } + + if (rover != NULL) { + /* success: route that frame */ + if ((rover->rcf & TR_RCF_LEN_MASK) >> 8) { + __u16 rcf = rover->rcf; + memcpy(trh->rseg,rover->rseg,sizeof(trh->rseg)); + rcf ^= TR_RCF_DIR_BIT; + rcf &= ~TR_RCF_BROADCAST_MASK; + trh->rcf = htons(rcf); + trh->saddr[0] |= TR_RII; + } + rover->access_time = now.tv_sec; + } else { + /* we don't have any routing information so send a + * limited broadcast */ + trh->saddr[0] |= TR_RII; + trh->rcf = ((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK; + trh->rcf |= (TR_RCF_FRAME2K | TR_RCF_LIMITED_BROADCAST); + trh->rcf = htons(trh->rcf); + } + } + + /* return how much of the header we've actually used */ + if (trh->saddr[0] & TR_RII) + route_len = (ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8; + else + route_len = 0; + + return sizeof (struct trh_hdr) - TR_MAXRIFLEN + route_len; + } + + /* + * save any source routing information + */ + static void save_source_routing(trh, interface) + struct trh_hdr *trh; + struct interface_info *interface; + { + struct routing_entry *rover; + struct timeval now; + unsigned char saddr[TR_ALEN]; + __u16 rcf = 0; + + gettimeofday(&now, NULL); + + memcpy(saddr, trh->saddr, sizeof(saddr)); + saddr[0] &= 0x7f; /* strip off source routing present flag */ + + /* scan our table to see if we've got it */ + for (rover = routing_info; rover != NULL; rover = rover->next) { + if (memcmp(&rover->addr[0], &saddr[0], TR_ALEN) == 0) + break; + } + + /* found an entry so update it with fresh information */ + if (rover != NULL) { + if ((trh->saddr[0] & TR_RII) + && (((ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8) > 2)) { + rcf = ntohs(trh->rcf); + rcf &= ~TR_RCF_BROADCAST_MASK; + memcpy(rover->rseg, trh->rseg, sizeof(rover->rseg)); + } + rover->rcf = rcf; + rover->access_time = now.tv_sec; + return; /* that's all folks */ + } + + /* no entry found, so create one */ + rover = malloc(sizeof(struct routing_entry)); + if (rover == NULL) { + fprintf(stderr, + "%s: unable to save source routing information\n", + __FILE__); + return; + } + + memcpy(rover->addr, saddr, sizeof(rover->addr)); + memcpy(rover->iface, interface->name, 5); + rover->access_time = now.tv_sec; + if (trh->saddr[0] & TR_RII) { + if (((ntohs(trh->rcf) & TR_RCF_LEN_MASK) >> 8) > 2) { + rcf = ntohs(trh->rcf); + rcf &= ~TR_RCF_BROADCAST_MASK; + memcpy(rover->rseg, trh->rseg, sizeof(rover->rseg)); + } + rover->rcf = rcf; + } + + /* insert into list */ + rover->next = routing_info; + routing_info = rover; + + return; + } + + /* + * get rid of old routes + */ + static void expire_routes() + { + struct routing_entry *rover; + struct routing_entry **prover = &routing_info; + struct timeval now; + + gettimeofday(&now, NULL); + + while((rover = *prover) != NULL) { + if ((now.tv_sec - rover->access_time) > routing_timeout) { + *prover = rover->next; + free(rover); + } else + prover = &rover->next; + } + + /* Reset the timer */ + routing_timer.tv_sec = now.tv_sec + routing_timeout; + routing_timer.tv_usec = now.tv_usec; + } + + #endif diff -rNc2 dhcp-2.0b1pl27/includes/cf/hpux.h dhcp-2.0/includes/cf/hpux.h *** dhcp-2.0b1pl27/includes/cf/hpux.h Fri Nov 21 23:52:40 1997 --- dhcp-2.0/includes/cf/hpux.h Tue Jun 22 07:50:19 1999 *************** *** 83,84 **** --- 83,88 ---- #define random rand + + #define BIG_ENDIAN 1 + #define LITTLE_ENDIEN 2 + #define BYTE_ORDER BIG_ENDIAN diff -rNc2 dhcp-2.0b1pl27/includes/cf/linux.h dhcp-2.0/includes/cf/linux.h *** dhcp-2.0b1pl27/includes/cf/linux.h Sat Feb 27 13:44:26 1999 --- dhcp-2.0/includes/cf/linux.h Thu May 27 10:44:53 1999 *************** *** 120,123 **** --- 120,124 ---- # define PROCDEV_DEVICE "/proc/net/dev" # define HAVE_ARPHRD_TUNNEL + # define HAVE_TR_SUPPORT # endif # define HAVE_ARPHRD_METRICOM diff -rNc2 dhcp-2.0b1pl27/includes/dhcpd.h dhcp-2.0/includes/dhcpd.h *** dhcp-2.0b1pl27/includes/dhcpd.h Tue Apr 6 08:02:18 1999 --- dhcp-2.0/includes/dhcpd.h Thu May 27 10:44:52 1999 *************** *** 107,110 **** --- 107,112 ---- struct shared_network *shared_network; struct option_data options [256]; + int got_requested_address; /* True if client sent the + dhcp-requested-address option. */ }; *************** *** 164,167 **** --- 166,175 ---- u_int8_t *prl; int prl_len; + int got_requested_address; /* True if client sent the + dhcp-requested-address option. */ + int got_server_identifier; /* True if client sent the + dhcp-server-identifier option. */ + struct shared_network *shared_network; /* Shared network of interface + on which request arrived. */ u_int32_t xid; *************** *** 921,924 **** --- 929,946 ---- int, struct sockaddr_in *, unsigned char *, int)); + + /* ethernet.c */ + void assemble_ethernet_header PROTO ((struct interface_info *, unsigned char *, + int *, struct hardware *)); + ssize_t decode_ethernet_header PROTO ((struct interface_info *, + unsigned char *, + int, struct hardware *)); + + /* tr.c */ + void assemble_tr_header PROTO ((struct interface_info *, unsigned char *, + int *, struct hardware *)); + ssize_t decode_tr_header PROTO ((struct interface_info *, + unsigned char *, + int, struct hardware *)); /* dhxpxlt.c */ diff -rNc2 dhcp-2.0b1pl27/includes/version.h dhcp-2.0/includes/version.h *** dhcp-2.0b1pl27/includes/version.h Wed Dec 31 16:00:00 1969 --- dhcp-2.0/includes/version.h Tue Jun 22 07:29:38 1999 *************** *** 0 **** --- 1,3 ---- + /* Current version of ISC DHCP Distribution. */ + + #define DHCP_VERSION "2.0" diff -rNc2 dhcp-2.0b1pl27/relay/Makefile.dist dhcp-2.0/relay/Makefile.dist *** dhcp-2.0b1pl27/relay/Makefile.dist Sat Apr 24 09:45:50 1999 --- dhcp-2.0/relay/Makefile.dist Sun May 9 09:09:23 1999 *************** *** 85,86 **** --- 85,92 ---- # Dependencies (semi-automatically-generated) + + dhcrelay.o: dhcrelay.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h ../includes/version.h diff -rNc2 dhcp-2.0b1pl27/relay/dhcrelay.c dhcp-2.0/relay/dhcrelay.c *** dhcp-2.0b1pl27/relay/dhcrelay.c Sat Apr 24 09:55:21 1999 --- dhcp-2.0/relay/dhcrelay.c Tue Jun 22 06:38:39 1999 *************** *** 43,50 **** #ifndef lint static char ocopyright [] = ! "$Id: dhcrelay.c,v 1.9.2.30 1999/04/24 16:55:21 mellon Exp $ Copyright (c) 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" static void usage PROTO ((char *)); --- 43,51 ---- #ifndef lint static char ocopyright [] = ! "$Id: dhcrelay.c,v 1.9.2.32 1999/06/22 13:38:39 mellon Exp $ Copyright (c) 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" + #include "version.h" static void usage PROTO ((char *)); *************** *** 77,81 **** "Copyright 1997, 1998, 1999 The Internet Software Consortium."; static char arr [] = "All rights reserved."; ! static char message [] = "Internet Software Consortium DHCP Relay Agent V2.0b1pl27"; static char contrib [] = "Please contribute if you find this software useful."; static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html"; --- 78,82 ---- "Copyright 1997, 1998, 1999 The Internet Software Consortium."; static char arr [] = "All rights reserved."; ! static char message [] = "Internet Software Consortium DHCP Relay Agent"; static char contrib [] = "Please contribute if you find this software useful."; static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html"; *************** *** 92,96 **** char *s; ! s = strchr (argv [0], '/'); if (!s) s = argv [0]; --- 93,97 ---- char *s; ! s = strrchr (argv [0], '/'); if (!s) s = argv [0]; *************** *** 170,174 **** if (!quiet) { ! note (message); note (copyright); note (arr); --- 171,175 ---- if (!quiet) { ! note ("%s %s", message, DHCP_VERSION); note (copyright); note (arr); diff -rNc2 dhcp-2.0b1pl27/relay/dhcrelay.cat8 dhcp-2.0/relay/dhcrelay.cat8 *** dhcp-2.0b1pl27/relay/dhcrelay.cat8 Fri Nov 21 23:58:30 1997 --- dhcp-2.0/relay/dhcrelay.cat8 Sun May 9 09:12:12 1999 *************** *** 15,20 **** The Internet Software Consortium DHCP Relay Agent, dhcre­ lay, provides a means for relaying DHCP and BOOTP requests ! from a subnet to which no DHCP server is directly to one ! or more DHCP servers on other subnets. OOPPEERRAATTIIOONN --- 15,20 ---- The Internet Software Consortium DHCP Relay Agent, dhcre­ lay, provides a means for relaying DHCP and BOOTP requests ! from a subnet to which no DHCP server is directly con­ ! nected to one or more DHCP servers on other subnets. OOPPEERRAATTIIOONN *************** *** 49,62 **** should be followed by the udp port number that dhcrelay should use. This is mostly useful for debugging purposes. ! Dhcrelay will normally run in the foreground until it has ! configured an interface, and then will revert to running in the background. To run force dhcrelay to always run as - a foreground process, the --dd flag should be specified. - This is useful when running dhcrelay under a debugger, or - when running it out of inittab on System V systems. - - Dhcrelay will normally print its network configuration on - startup. This can be annoying in a system startup script --- 49,62 ---- should be followed by the udp port number that dhcrelay should use. This is mostly useful for debugging purposes. + If the --pp 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 --pp 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 --pp flag. ! Dhcrelay will normally run in the foreground until it has ! configured an interface, and then will revert to running in the background. To run force dhcrelay to always run as *************** *** 71,78 **** - to disable this behaviour, specify the _-_q flag. ! The name of at least one DHCP server to which DHCP and ! BOOTP requests should be relayed must be specified on the command line. --- 71,84 ---- + a foreground process, the --dd flag should be specified. + This is useful when running dhcrelay under a debugger, or + when running it out of inittab on System V systems. + + Dhcrelay will normally print its network configuration on + startup. This can be annoying in a system startup script - to disable this behaviour, specify the _-_q flag. ! The name of at least one DHCP server to which DHCP and ! BOOTP requests should be relayed must be specified on the command line. *************** *** 82,96 **** AAUUTTHHOORR ! ddhhccrreellaayy((88)) 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 hhttttpp::////wwwwww..vviixx..ccoomm//iisscc.. To learn more about Vixie Enterprises, see hhttttpp::////wwwwww..vviixx..ccoomm.. - - - - - - --- 88,96 ---- AAUUTTHHOORR ! ddhhccrreellaayy((88)) 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 hhttttpp::////wwwwww..vviixx..ccoomm//iisscc.. To learn more about Vixie Enterprises, see hhttttpp::////wwwwww..vviixx..ccoomm.. diff -rNc2 dhcp-2.0b1pl27/server/Makefile.dist dhcp-2.0/server/Makefile.dist *** dhcp-2.0b1pl27/server/Makefile.dist Sat Apr 24 09:45:50 1999 --- dhcp-2.0/server/Makefile.dist Sun May 9 09:09:23 1999 *************** *** 67,71 **** clean: -rm -f $(OBJS) ! realclean: clean -rm -f $(PROG) $(CATMANPAGES) $(SEDMANPAGES) *~ #* --- 67,71 ---- clean: -rm -f $(OBJS) ! realclean: clean -rm -f $(PROG) $(CATMANPAGES) $(SEDMANPAGES) *~ #* *************** *** 103,104 **** --- 103,130 ---- # Dependencies (semi-automatically-generated) + + dhcpd.o: dhcpd.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h ../includes/version.h + dhcp.o: dhcp.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + bootp.o: bootp.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h + confpars.o: confpars.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h ../includes/dhctoken.h + db.o: db.c ../includes/dhcpd.h \ + ../includes/cdefs.h ../includes/osdep.h ../includes/site.h \ + ../includes/cf/netbsd.h ../includes/dhcp.h \ + ../includes/tree.h ../includes/hash.h ../includes/inet.h \ + ../includes/sysconf.h diff -rNc2 dhcp-2.0b1pl27/server/bootp.c dhcp-2.0/server/bootp.c *** dhcp-2.0b1pl27/server/bootp.c Thu Apr 8 14:39:34 1999 --- dhcp-2.0/server/bootp.c Tue Jun 22 06:40:31 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: bootp.c,v 1.28.2.6 1999/04/08 21:39:34 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 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.8 1999/06/22 13:40:31 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 286,290 **** raw.xid = packet -> raw -> xid; raw.secs = packet -> raw -> secs; ! raw.flags = 0; raw.ciaddr = packet -> raw -> ciaddr; memcpy (&raw.yiaddr, ip_address.iabuf, sizeof raw.yiaddr); --- 286,290 ---- raw.xid = packet -> raw -> xid; raw.secs = packet -> raw -> secs; ! raw.flags = packet -> raw -> flags; raw.ciaddr = packet -> raw -> ciaddr; memcpy (&raw.yiaddr, ip_address.iabuf, sizeof raw.yiaddr); *************** *** 301,314 **** raw.giaddr = packet -> raw -> giaddr; ! if (hp -> group -> server_name) { strncpy (raw.sname, hp -> group -> server_name, ! (sizeof raw.sname) - 1); ! raw.sname [(sizeof raw.sname) - 1] = 0; ! } ! if (hp -> group -> filename) { strncpy (raw.file, hp -> group -> filename, ! (sizeof raw.file) - 1); ! raw.file [(sizeof raw.file) - 1] = 0; ! } else memcpy (raw.file, packet -> raw -> file, sizeof raw.file); --- 301,318 ---- raw.giaddr = packet -> raw -> giaddr; ! if (hp -> group -> server_name) strncpy (raw.sname, hp -> group -> server_name, ! (sizeof raw.sname)); ! else if (subnet -> group -> server_name) ! strncpy (raw.sname, subnet -> group -> server_name, ! (sizeof raw.sname)); ! ! if (hp -> group -> filename) strncpy (raw.file, hp -> group -> filename, ! (sizeof raw.file)); ! else if (subnet -> group -> filename) ! strncpy (raw.file, subnet -> group -> filename, ! (sizeof raw.file)); ! else memcpy (raw.file, packet -> raw -> file, sizeof raw.file); diff -rNc2 dhcp-2.0b1pl27/server/confpars.c dhcp-2.0/server/confpars.c *** dhcp-2.0b1pl27/server/confpars.c Tue Apr 6 08:18:27 1999 --- dhcp-2.0/server/confpars.c Thu May 27 10:47:16 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: confpars.c,v 1.45.2.10 1999/04/06 15:18:27 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.11 1999/05/27 17:47:16 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 774,779 **** 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) --- 774,778 ---- else { u = (struct subnet *)0; ! for (t = share -> subnets; t; t = t -> next_sibling) { if (subnet_inner_than (subnet, t, 0)) { if (u) *************** *** 786,790 **** u = t; } ! t -> next_sibling = subnet; } } --- 785,789 ---- u = t; } ! u -> next_sibling = subnet; } } diff -rNc2 dhcp-2.0b1pl27/server/db.c dhcp-2.0/server/db.c *** dhcp-2.0b1pl27/server/db.c Sat Apr 24 09:50:05 1999 --- dhcp-2.0/server/db.c Thu May 6 14:58:46 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: db.c,v 1.17.2.2 1999/04/24 16:50:05 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.3 1999/05/06 21:58:46 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 237,243 **** "your local timezone. This is\n"); fprintf (db_file, "# not a bug, so please don't ask about it. %s", ! "The format of this file is\n"); ! fprintf (db_file, ! "# documented in the dhcpd.leases(5) manual page.\n\n"); /* Write out all the leases that we know of... */ --- 237,248 ---- "your local timezone. This is\n"); fprintf (db_file, "# not a bug, so please don't ask about it. %s", ! "There is no portable way to\n"); ! fprintf (db_file, "# store leases in the local timezone, so please %s", ! "don't request this as a\n"); ! fprintf (db_file, "# feature. If this is inconvenient or %s", ! "confusing to you, we sincerely\n"); ! fprintf (db_file, "# apologize. Seriously, though - don't ask.\n"); ! fprintf (db_file, "# The format of this file is documented in the %s", ! "dhcpd.leases(5) manual page.\n\n"); /* Write out all the leases that we know of... */ diff -rNc2 dhcp-2.0b1pl27/server/dhcp.c dhcp-2.0/server/dhcp.c *** dhcp-2.0b1pl27/server/dhcp.c Sat Apr 24 09:52:33 1999 --- dhcp-2.0/server/dhcp.c Tue Jun 22 06:42:15 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: dhcp.c,v 1.57.2.26 1999/04/24 16:52:33 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 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.29 1999/06/22 13:42:15 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 120,124 **** warning message, so that if it continues to lose, the administrator will eventually investigate. */ ! if (lease -> flags & ABANDONED_LEASE) { struct lease *lp; --- 120,124 ---- warning message, so that if it continues to lose, the administrator will eventually investigate. */ ! if ((lease -> flags & ABANDONED_LEASE)) { struct lease *lp; *************** *** 127,131 **** if (lp -> ends > cur_time) break; ! if (!lp -> flags & ABANDONED_LEASE) { lease = lp; break; --- 127,131 ---- if (lp -> ends > cur_time) break; ! if (!(lp -> flags & ABANDONED_LEASE)) { lease = lp; break; *************** *** 135,139 **** /* 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)); --- 135,139 ---- /* 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)); *************** *** 351,354 **** --- 351,364 ---- return; } + + /* At this point, the client has requested a lease, and it's + available, but it wasn't assigned to the client, which + means that the client probably hasn't gone through the + DHCPDISCOVER part of the protocol. We are within our + rights to send a DHCPNAK. We can also send a DHCPACK. + The thing we probably should not do is to remain silent. + For now, we'll just assign the lease to the client anyway. */ + if (lease) + ack_lease (packet, lease, DHCPACK, 0); } *************** *** 634,637 **** --- 644,653 ---- error ("unable to allocate lease state!"); memset (state, 0, sizeof *state); + state -> got_requested_address = packet -> got_requested_address; + state -> shared_network = packet -> interface -> shared_network; + + /* Remember if we got a server identifier option. */ + if (packet -> options [DHO_DHCP_SERVER_IDENTIFIER].len) + state -> got_server_identifier = 1; /* Replace the old lease hostname with the new one, if it's changed. */ *************** *** 830,857 **** state -> offer = offer; - /* Get the Maximum Message Size option from the packet, if one - was sent. */ - if (packet -> options [DHO_DHCP_MAX_MESSAGE_SIZE].data && - (packet -> options [DHO_DHCP_MAX_MESSAGE_SIZE].len >= - sizeof (u_int16_t))) - state -> max_message_size = - getUShort (packet -> options - [DHO_DHCP_MAX_MESSAGE_SIZE].data); - - /* Save the parameter request list if there is one. */ - i = DHO_DHCP_PARAMETER_REQUEST_LIST; - if (packet -> options [i].data) { - state -> prl = dmalloc (packet -> options [i].len, - "ack_lease: prl"); - if (!state -> prl) - warn ("no memory for parameter request list"); - else { - memcpy (state -> prl, - packet -> options [i].data, - packet -> options [i].len); - state -> prl_len = packet -> options [i].len; - } - } - /* Figure out what options to send to the client: */ --- 846,849 ---- *************** *** 894,897 **** --- 886,916 ---- } + /* Get the Maximum Message Size option from the packet, if one + was sent. */ + i = DHO_DHCP_MAX_MESSAGE_SIZE; + if (packet -> options [i].data && + (packet -> options [i].len == sizeof (u_int16_t))) + state -> max_message_size = + getUShort (packet -> options [i].data); + /* Otherwise, if a maximum message size was specified, use that. */ + else if (state -> options [i] && state -> options [i] -> value) + state -> max_message_size = + getUShort (state -> options [i] -> value); + + /* Save the parameter request list if there is one. */ + i = DHO_DHCP_PARAMETER_REQUEST_LIST; + if (packet -> options [i].data) { + state -> prl = dmalloc (packet -> options [i].len, + "ack_lease: prl"); + if (!state -> prl) + warn ("no memory for parameter request list"); + else { + memcpy (state -> prl, + packet -> options [i].data, + packet -> options [i].len); + state -> prl_len = packet -> options [i].len; + } + } + /* If we didn't get a hostname from an option somewhere, see if we can get one from the lease. */ *************** *** 1121,1124 **** --- 1140,1145 ---- struct lease_state *state = lease -> state; int nulltp, bootpp; + u_int8_t *prl; + int prl_len; if (!state) *************** *** 1159,1167 **** bootpp = 1; /* Insert such options as will fit into the buffer. */ packet_length = cons_options ((struct packet *)0, &raw, state -> max_message_size, ! state -> options, bufs, nulltp, bootpp, ! state -> prl, state -> prl_len); /* Having done the cons_options(), we can release the tree_cache --- 1180,1202 ---- bootpp = 1; + if (state -> options [DHO_DHCP_PARAMETER_REQUEST_LIST] && + state -> options [DHO_DHCP_PARAMETER_REQUEST_LIST] -> value) { + prl = state -> options + [DHO_DHCP_PARAMETER_REQUEST_LIST] -> value; + prl_len = state -> options + [DHO_DHCP_PARAMETER_REQUEST_LIST] -> len; + } else if (state -> prl) { + prl = state -> prl; + prl_len = state -> prl_len; + } else { + prl = (u_int8_t *)0; + prl_len = 0; + } + /* Insert such options as will fit into the buffer. */ packet_length = cons_options ((struct packet *)0, &raw, state -> max_message_size, ! state -> options, ! bufs, nulltp, bootpp, prl, prl_len); /* Having done the cons_options(), we can release the tree_cache *************** *** 1248,1253 **** /* If the client is RENEWING, unicast to the client using the ! regular IP stack. */ ! } else if (raw.ciaddr.s_addr && state -> offer == DHCPACK) { to.sin_addr = raw.ciaddr; to.sin_port = remote_port; --- 1283,1302 ---- /* If the client is RENEWING, unicast to the client using the ! regular IP stack. Some clients, particularly those that ! follow RFC1541, are buggy, and send both ciaddr and ! server-identifier. We deal with this situation by assuming ! that if we got both dhcp-server-identifier and ciaddr, and ! giaddr was not set, then the client is on the local ! network, and we can therefore unicast or broadcast to it ! successfully. A client in REQUESTING state on another ! network that's making this mistake will have set giaddr, ! and will therefore get a relayed response from the above ! code. */ ! } else if (raw.ciaddr.s_addr && ! !((state -> got_server_identifier || ! (raw.flags & htons (BOOTP_BROADCAST))) && ! /* XXX This won't work if giaddr isn't zero, but it is: */ ! (state -> shared_network == lease -> shared_network)) && ! state -> offer == DHCPACK) { to.sin_addr = raw.ciaddr; to.sin_port = remote_port; *************** *** 1304,1307 **** --- 1353,1357 ---- if (packet -> options [DHO_DHCP_REQUESTED_ADDRESS].len && packet -> options [DHO_DHCP_REQUESTED_ADDRESS].len == 4) { + packet -> got_requested_address = 1; cip.len = 4; memcpy (cip.iabuf, *************** *** 1381,1385 **** for (; hw_lease; hw_lease = hw_lease -> n_hw) { if (hw_lease -> shared_network == share) { ! if (hw_lease -> flags & ABANDONED_LEASE) continue; if (packet -> packet_type) --- 1431,1435 ---- for (; hw_lease; hw_lease = hw_lease -> n_hw) { if (hw_lease -> shared_network == share) { ! if ((hw_lease -> flags & ABANDONED_LEASE)) continue; if (packet -> packet_type) *************** *** 1412,1417 **** 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"); --- 1462,1465 ---- diff -rNc2 dhcp-2.0b1pl27/server/dhcpd.c dhcp-2.0/server/dhcpd.c *** dhcp-2.0b1pl27/server/dhcpd.c Sat Apr 24 09:55:18 1999 --- dhcp-2.0/server/dhcpd.c Tue Jun 22 06:43:18 1999 *************** *** 43,47 **** #ifndef lint static char ocopyright[] = ! "$Id: dhcpd.c,v 1.45.2.28 1999/04/24 16:55:18 mellon Exp $ Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium."; #endif --- 43,47 ---- #ifndef lint static char ocopyright[] = ! "$Id: dhcpd.c,v 1.45.2.30 1999/06/22 13:43:18 mellon Exp $ Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium."; #endif *************** *** 49,57 **** "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.0b1pl27"; static char contrib [] = "Please contribute if you find this software useful."; static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html"; #include "dhcpd.h" static void usage PROTO ((char *)); --- 49,58 ---- "Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium."; static char arr [] = "All rights reserved."; ! static char message [] = "Internet Software Consortium DHCP Server"; static char contrib [] = "Please contribute if you find this software useful."; static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html"; #include "dhcpd.h" + #include "version.h" static void usage PROTO ((char *)); *************** *** 93,97 **** int quiet = 0; ! appname = strchr (argv [0], '/'); if (!appname) appname = argv [0]; --- 94,98 ---- int quiet = 0; ! appname = strrchr (argv [0], '/'); if (!appname) appname = argv [0]; *************** *** 179,183 **** if (!quiet) { ! note (message); note (copyright); note (arr); --- 180,184 ---- if (!quiet) { ! note ("%s %s", message, DHCP_VERSION); note (copyright); note (arr); diff -rNc2 dhcp-2.0b1pl27/server/dhcpd.cat8 dhcp-2.0/server/dhcpd.cat8 *** dhcp-2.0b1pl27/server/dhcpd.cat8 Fri Nov 21 23:15:53 1997 --- dhcp-2.0/server/dhcpd.cat8 Sun May 9 09:12:12 1999 *************** *** 123,128 **** (port 67), the --pp flag may used. It should be followed by the udp port number on which dhcpd should listen. This is ! mostly useful for debugging purposes. ! --- 123,128 ---- (port 67), the --pp 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 --pp flag is ! specified, the server will transmit responses to clients *************** *** 137,140 **** --- 137,148 ---- + at a port number that is one greater than the one speci­ + fied - i.e., if you specify --pp 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 --pp 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. + To run dhcpd as a foreground process, rather than allowing it to run as a daemon in the background, the --ff flag *************** *** 183,194 **** } - Multiple address ranges may be specified like this: - - subnet 239.252.197.0 netmask 255.255.255.0 { - range 239.252.197.10 239.252.197.107; - range 239.252.197.113 239.252.197.250; - } - - If a subnet will only be provided with BOOTP service and --- 191,194 ---- *************** *** 203,206 **** --- 203,214 ---- + Multiple address ranges may be specified like this: + + subnet 239.252.197.0 netmask 255.255.255.0 { + range 239.252.197.10 239.252.197.107; + range 239.252.197.113 239.252.197.250; + } + + If a subnet will only be provided with BOOTP service and no dynamic address assignment, the range clause can be left out entirely, but the subnet statement must appear. *************** *** 249,260 **** dhcpd.conf file. A very basic client declaration will specify the client network interface's hardware address - and the IP address to assign to that client. If the - client needs to be able to load a boot file from the - server, that file's name must be specified. A simple - bootp client declaration might look like this: - - host haagen { - hardware ethernet 08:00:2b:4c:59:23; - fixed-address 239.252.197.9; --- 257,260 ---- *************** *** 269,272 **** --- 269,280 ---- + and the IP address to assign to that client. If the + client needs to be able to load a boot file from the + server, that file's name must be specified. A simple + bootp client declaration might look like this: + + host haagen { + hardware ethernet 08:00:2b:4c:59:23; + fixed-address 239.252.197.9; filename "/tftpboot/haagen.boot"; } *************** *** 315,326 **** FFIILLEESS //eettcc//ddhhccppdd..ccoonnff,, //vvaarr//ddbb//ddhhccppdd..lleeaasseess,, //vvaarr//rruunn//ddhhccppdd..ppiidd,, - //vvaarr//ddbb//ddhhccppdd..lleeaasseess~~.. - - SSEEEE AALLSSOO - dhclient(8), dhcrelay(8), dhcpd.conf(5), dhcpd.leases(5) - - AAUUTTHHOORR - ddhhccppdd((88)) was written by Ted Lemon under a - contract with Vixie Labs. Funding for this project was --- 323,326 ---- *************** *** 335,349 **** provided by the Internet Software Corporation. Informa­ tion about the Internet Software Consortium can be found at hhttttpp::////wwwwww..iisscc..oorrgg//iisscc.. - - - - - - - - --- 335,349 ---- + //vvaarr//ddbb//ddhhccppdd..lleeaasseess~~.. + + SSEEEE AALLSSOO + dhclient(8), dhcrelay(8), dhcpd.conf(5), dhcpd.leases(5) + + 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.. diff -rNc2 dhcp-2.0b1pl27/server/dhcpd.conf.cat5 dhcp-2.0/server/dhcpd.conf.cat5 *** dhcp-2.0b1pl27/server/dhcpd.conf.cat5 Tue Feb 23 14:12:51 1999 --- dhcp-2.0/server/dhcpd.conf.cat5 Sun May 9 09:12:12 1999 *************** *** 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 --- 533,538 ---- ! by colons. The _h_a_r_d_w_a_r_e statement may also be used for ! DHCP clients. TThhee _f_i_l_e_n_a_m_e ssttaatteemmeenntt *************** *** 760,763 **** --- 760,781 ---- to use this flag. + TThhee _a_l_w_a_y_s_-_r_e_p_l_y_-_r_f_c_1_0_4_8 ssttaatteemmeenntt + + aallwwaayyss--rreeppllyy--rrffcc11004488 _f_l_a_g;; + + Some BOOTP clients expect RFC1048-style responses, but do + not follow RFC1048 when sending their requests. You can + tell that a client is having this problem if it is not + getting the options you have configured for it and if you + see in the server log the message "(non-rfc1048)" printed + with each BOOTREQUEST that is logged. + + If you want to send rfc1048 options to such a client, you + can set the aallwwaayyss--rreeppllyy--rrffcc11004488 option in that client's + host declaration, and the DHCP server will respond with an + RFC-1048-style vendor options field. This flag can be + set in any scope, and will affect all clients covered by + that scope. + TThhee _s_e_r_v_e_r_-_i_d_e_n_t_i_f_i_e_r ssttaatteemmeenntt *************** *** 767,770 **** --- 785,800 ---- value that is sent in the DHCP Server Identifier option for a given scope. The value specified mmuusstt be an IP + + + + 12 + + + + + + dhcpd.conf(5) dhcpd.conf(5) + + address for the DHCP server, and must be reachable by all clients served by a particular scope. *************** *** 786,800 **** 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. --- 816,819 ---- *************** *** 813,835 **** tion about the Internet Software Consortium can be found at hhttttpp::////wwwwww..iisscc..oorrgg//iisscc.. - - - - - - - - - - - - - - - - - - - --- 832,835 ----