diff -rNc2 dhcp-2.0b1pl18/Makefile.conf dhcp-2.0b1pl25/Makefile.conf *** dhcp-2.0b1pl18/Makefile.conf Sat Feb 27 13:41:10 1999 --- dhcp-2.0b1pl25/Makefile.conf Tue Apr 6 08:32:20 1999 *************** *** 35,46 **** BINDIR = /usr/sbin CLIENTBINDIR=/sbin - ADMMANDIR = /usr/share/man/cat8 ADMMANEXT = .0 - FFMANDIR = /usr/share/man/cat5 FFMANEXT = .0 INSTALL = install -c MANINSTALL = install -c -m 444 CHMOD = chmod CATMANPAGES = ETC = /etc VARRUN = /var/run --- 35,47 ---- BINDIR = /usr/sbin CLIENTBINDIR=/sbin ADMMANEXT = .0 FFMANEXT = .0 + ADMMANDIR = /usr/share/man/cat8 + FFMANDIR = /usr/share/man/cat5 INSTALL = install -c MANINSTALL = install -c -m 444 CHMOD = chmod CATMANPAGES = + MANCAT = cat ETC = /etc VARRUN = /var/run *************** *** 59,62 **** --- 60,75 ---- # assignments, and writes the output to Makefile. + ## AIX 4.1.5.0 + ##--aix-- + #CF = cf/aix.h + #CC=cc -Daix + #INSTALL=/usr/ucb/install + #MANINSTALL=/usr/ucb/install + #ADMMANEXT = .8 + #FFMANEXT = .5 + #VARRUN = /etc + #VARDB = /etc + ##--aix-- + ## NEXTSTEP 3.x,4.x ##--nextstep-- *************** *** 129,133 **** #ADMMANEXT = .8 #FFMANEXT = .5 - #VARRUN = /etc #VARDB = /etc ##--alphaosf-- --- 142,145 ---- *************** *** 183,186 **** --- 195,199 ---- #FFMANDIR = /usr/man/man5 #FFMANEXT = .5 + #MANCAT = #VARRUN = /var/run #VARDB = /var/state/dhcp # see rationale in includes/cf/linux.h *************** *** 196,199 **** --- 209,213 ---- #FFMANDIR = /usr/man/man5 #FFMANEXT = .5 + #MANCAT = #VARRUN = /var/run #VARDB = /var/state/dhcp # see rationale in includes/cf/linux.h *************** *** 209,212 **** --- 223,227 ---- #FFMANDIR = /usr/share/man/man5 #FFMANEXT = .5 + #MANCAT = #VARRUN = /var/run #VARDB = /var/state/dhcp # see rationale in includes/cf/linux.h *************** *** 222,225 **** --- 237,241 ---- #FFMANDIR = /usr/share/man/man5 #FFMANEXT = .5 + #MANCAT = #VARRUN = /var/run #VARDB = /var/state/dhcp # see rationale in includes/cf/linux.h *************** *** 253,256 **** --- 269,273 ---- #FFMANDIR = /usr/man/man5 #FFMANEXT = .5 + #MANCAT = #VARRUN = /etc #COPTS=-w3 -Dlint *************** *** 282,283 **** --- 299,321 ---- #STRIP=/usr/local/i386-unknown-cygwin32/bin/strip ##--cygwin32-- + + ## IRIX 6.x + ##--irix-- + #LIBS = -lbind + #LFLAGS=$(DEBUG) -L/usr/local/lib -Wl,-woff,84 -Wl,-woff,85 -Wl,-woff,134 + #CC=gcc + #COPTS = -I/usr/local/include + #CF = cf/irix.h + #BINDIR = /usr/local/etc + #ADMMANDIR = /usr/local/man/man8 + #ADMMANEXT = .8 + #FFMANDIR = /usr/local/man/man5 + #FFMANEXT = .5 + #MANCAT = + #INSTALL = install + #MANINSTALL = install + #CHMOD = chmod + #ETC = /etc + #VARRUN = /etc + #VARDB = /usr/local/etc/dhcp + ##--irix-- diff -rNc2 dhcp-2.0b1pl18/README dhcp-2.0b1pl25/README *** dhcp-2.0b1pl18/README Fri Mar 5 08:13:53 1999 --- dhcp-2.0b1pl25/README Fri Apr 9 10:42:04 1999 *************** *** 1,6 **** Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 18 ! March 5, 1998 This is the first Beta release of Version 2 of the Internet Software --- 1,47 ---- Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 25 ! April 9, 1999 ! ! Documentation for this software includes this README file, the ! RELNOTES file, and the manual pages, which are in the server, common, ! client and relay subdirectories. Internet standards relating to the ! DHCP protocol are stored in the doc subdirectory. You will have the ! best luck reading the manual pages if you build this software and then ! install it, although you can read them directly out of the ! distribution if you need to. ! ! DHCP server documentation is in the dhcpd man page. Information about ! the DHCP server lease database is in the dhcpd.leases man page. ! Server configuration documentation is in the dhcpd.conf man page as ! well as the dhcp-options man page. A sample DHCP server ! configuration is in the file server/dhcpd.conf. ! ! DHCP Client documentation is in the dhclient man page. DHCP client ! configuration documentation is in the dhclient.conf man page and the ! dhcp-options man page. The DHCP client configuration script is ! documented in the dhclient-script man page. The format of the DHCP ! client lease database is documented in the dhclient.leases man page. ! ! DHCP relay agent documentation is in the dhcrelay man page. ! ! To read installed manual pages, use the man command. Type "man page" ! where page is the name of the manual page. ! ! If you want to read manual pages that aren't installed, you can type ! ``nroff -man page |more'' where page is the filename of the ! unformatted manual page. The filename of an unformatted manual page ! is the name of the manual page, followed by '.', followed by some ! number - 5 for documentation about files, and 8 for documentation ! about programs. ! ! If you do not have the nroff command, you can type ``more catpage'' ! where catpage is the filename of the catted man page. Catted man ! pages names are the name of the manual page followed by ".cat" ! followed by 5 or 8, as with unformatted manual pages. ! ! Please note that until you install the manual pages, the pathnames of ! files to which they refer will not be correct for your operating ! system. This is the first Beta release of Version 2 of the Internet Software *************** *** 13,24 **** In this release, the server and relay agent currently work well on ! NetBSD, Linux, FreeBSD, BSD/OS, Ultrix, Digital Alpha OSF/1, and SunOS ! 4.1.4. They can also be run usefully on Solaris as long as only one ! broadcast network interface is configured. They also runs on QNX as ! long as only one broadcast network interface is configured and a host ! route is added from that interface to the 255.255.255.255 broadcast ! address. If you are running a Linux 2.0.30 or previous kernel, the ! DHCP daemons will only be able to operate on machines with a single ! network interface. The DHCP client currently only knows how to configure the network on --- 54,63 ---- 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 *************** *** 48,54 **** the tar utility and the gzip command - type something like: ! zcat dhcp-2.0b1pl18.tar.gz |tar xvf - ! Now, cd to the dhcp-2.0b1pl18 subdirectory that you've just created and configure the source tree by typing: --- 87,96 ---- the tar utility and the gzip command - type something like: ! zcat dhcp-2.0b1pl25.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.0b1pl25 subdirectory that you've just created and configure the source tree by typing: *************** *** 104,117 **** One additional Linux 2.1/2.2 issue: if you get the following message, ! it's because your kernel doesn't have the linux packetfilter ! configured: ! Can't install packet filter program: Protocol not available ! exiting. If this happens, you need to edit your linux kernel .config file, set ! CONFIG_FILTER=y, and rebuild your kernel. If the preceding sentence ! made no sense to you, ask your Linux vendor/guru for help - please ! don't ask us. LINUX: BROADCAST --- 146,164 ---- One additional Linux 2.1/2.2 issue: if you get the following message, ! it's because your kernel doesn't have the linux packetfilter or raw ! packet socket configured: ! Set CONFIG_PACKET=y and CONFIG_FILTER=y in your kernel configuration If this happens, you need to edit your linux kernel .config file, set ! CONFIG_FILTER=y and CONFIG_PACKET=y, and rebuild your kernel. If the ! preceding sentence made no sense to you, ask your Linux vendor/guru ! for help - please don't ask us. ! ! If you set CONFIG_PACKET=m or CONFIG_FILTER=m, then you must tell the ! kernel module loader to load the appropriate modules. If this doesn't ! make sense to you, don't use CONFIG_whatever=m - use CONFIG_whatever=y. ! Don't ask for help with this on the DHCP mailing list - it's a Linux ! kernel issue. LINUX: BROADCAST *************** *** 276,282 **** --- 323,394 ---- dhcp-server and dhcp-announce mailing lists. If you will be using dhclient, you should subscribe to the dhcp-client mailing list. + + If you need help, you should ask on the dhcp-server or dhcp-client + mailing list (or both) - whichever is appropriate to your + application. This includes reporting bugs. Please do not report + bugs in old software releases - fetch the latest release and see if + the bug is still in that copy of the software, and if it's not, _then_ + report it. It's okay to report bugs in the latest patchlevel of a + major version that's not the most recent major version, though - for + example, if you're running 2.0, you don't have to upgrade to 3.0 + before you can report bugs. + + PLEASE READ THIS README FILE CAREFULLY BEFORE REPORTING BUGS! + + When you report bugs, please provide us complete information. A list + of information we need follows. Please read it carefully, and put + all the information you can into your initial bug report, so that we + don't have to ask you any questions in order to figure out your + problem. + + - The specific operating system name and version of the + machine on which the DHCP server or client is running. + - The specific operating system name and version of the + machine on which the client is running, if you are having + trouble getting a client working with the server. + - If you're running Linux, the version number we care about is + the kernel version and maybe the library version, not the + distribution version - e.g., while we don't mind knowing + that you're running Redhat version mumble.foo, we must know + what kernel version you're running, and it helps if you can + tell us what version of the C library you're running, + although if you don't know that off the top of your head it + may be hard for you to figure it out, so don't go crazy + trying. + - The specific version of the DHCP distribution you're + running, for example 2.0b1pl19, not 2.0. + - Please explain the problem carefully, thinking through what + you're saying to ensure that you don't assume we know + something about your situation that we don't know. + - Include your dhcpd.conf and dhcpd.leases file if they're not + huge (if they are huge, we may need them anyway, but don't + send them until you're asked). + - Include a log of your server or client running until it + encounters the problem - for example, if you are having + trouble getting some client to get an address, restart the + server with the -d flag and then restart the client, and + send us what the server prints. Likewise, with the client, + include the output of the client as it fails to get an + address or otherwise does the wrong thing. Do not leave + out parts of the output that you think aren't interesting. + - If the client or server is dumping core, please run the + debugger and get a stack trace, and include that in your + bug report. For example, if your debugger is gdb, do the + following: + + gdb dhcpd dhcpd.core + (gdb) where + [...] + (gdb) quit + + This assumes that it's the dhcp server you're debugging, and + that the core file is in dhcpd.core. + PLEASE DO NOT send queries about non-isc clients to the dhcp-client mailing list. If you're asking about them on an ISC mailing list, it's probably because you're using the ISC DHCP server, so ask there. + If you are having problems with a client whose executable is called + dhcpcd, this is _not_ the ISC DHCP client, and we probably can't help + you with it. Please see http://www.fugue.com/dhcp/lists for details on how to diff -rNc2 dhcp-2.0b1pl18/RELNOTES dhcp-2.0b1pl25/RELNOTES *** dhcp-2.0b1pl18/RELNOTES Fri Mar 5 08:11:54 1999 --- dhcp-2.0b1pl25/RELNOTES Fri Apr 9 10:42:43 1999 *************** *** 1,6 **** Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 18 ! March 5, 1998 Release Notes --- 1,6 ---- Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 25 ! April 9, 1999 Release Notes *************** *** 53,56 **** --- 53,167 ---- 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 24 + + - D'oh! Fix a really stupid mistake in hash.c. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 23 + + - Support an always-reply-rfc1048 flag, which says to reply with an + RFC1048-style vendor extensions buffer even if the client didn't + send an RFC1048-style magic number. + + - Fix a null pointer dereference. + + - Use netmask from subnet if no netmask option specified. + + - IRIX support (thanks to Don Badrak). + + - Install unformatted manual pages on Linux. + + - Add note in README about zcat vs. gzcat on BSD/os. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 22 + + - Test for lease before dereferencing it in dhcprequest. + + - Free the client parameter request list in dhcpnak if there is one. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 21 + + - Fix a pasto in options.c that will cause a core dump whenever a + client sends in a request without a parameter request list. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 20 + + - Actually do the client fix mentioned below - Patchlevel 20 only contained + half of the fix. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 19 + + - Removed arp table clearing code from solaris client script. + + - Document Linux "protocol not configured" error more thoroughly. + + - Clean up some unused variables. + + - Add entry and exit hooks to all dhcp client scripts, along with a + make_resolv_conf function that can be redefined in the entry hooks. + Document this new feature set. + + - Fix client to take advantage of network APIs that allow it to + receive a unicast instead of requesting that the DHCP server + broadcast its response. + + - Add -pf flag to all daemons allowing user to specify PID file name + on command line. + + - Undo a previous change that attempted to be clever about testing + interface flags but wound up being stupid instead. + + - Enforce access control on DHCPREQUEST messages as well as + DHCPDISCOVER messages. + + CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 18 + + - Support added for AIX 4.1.5.0 (and hopefully other versions). + + - Use /var/run instead of /etc on Digital Unix. + + - Change DHCP client exponential backoff code to back off more slowly, + so that it is more robust in lossy environments, at the expense of + being a bit less polite to the server. + + - Don't request a specific lease interval in the client unless the + user says to do so. + + - Don't print DHCPXXX in wrong xxx messages unless DEBUG is defined. + + - Fix handling of secs field. + + - Fix handling of append statement. + + - Fix documentation for append and prepend statements. + + - Fix server support for parameter request list and maximum message + size. + + - Parameterize more hardware types in discover_interfaces. Check for + IFF_BROADCAST instead of !IFF_POINTOPOINT + + - Print kernel configuration warning message if we get EINVAL when + opening or configuring the Linux packet filter. + + - Fix a bug in UDP checksum code (thanks to John Nemeth for figuring + this out) and re-enable UDP checksumming. This allows the client + to work with some buggy DHCP servers that can't handle zero + checksums in the UDP header - in particular, the one John's cable + modem ISP is using. + + - Don't report packet header checksum errors unless we see a lot of + them. It's perfectly normal for some number of checksum errors to + occur. + + - Refer to the dhcpd.leases man page when printing an error message + prior to exiting because there's no lease database. + + - Add information to the README telling the reader how to get to the + manual pages. + + - Fix the server packet transmission code to unicast when it can. + + - Fix a typo in the dhcpd.conf manual page. CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 17 diff -rNc2 dhcp-2.0b1pl18/client/Makefile.dist dhcp-2.0b1pl25/client/Makefile.dist *** dhcp-2.0b1pl18/client/Makefile.dist Tue Feb 23 10:09:36 1999 --- dhcp-2.0b1pl25/client/Makefile.dist Tue Apr 6 08:32:21 1999 *************** *** 65,75 **** $(CHMOD) 700 $(DESTDIR)$(ETC)/dhclient-script; \ fi ! $(MANINSTALL) $(MANFROM) dhclient.cat8 $(MANTO) \ $(DESTDIR)$(ADMMANDIR)/dhclient$(ADMMANEXT) ! $(MANINSTALL) $(MANFROM) dhclient-script.cat8 $(MANTO) \ $(DESTDIR)$(ADMMANDIR)/dhclient-script$(ADMMANEXT) ! $(MANINSTALL) $(MANFROM) dhclient.conf.cat5 $(MANTO) \ $(DESTDIR)$(FFMANDIR)/dhclient.conf$(FFMANEXT) ! $(MANINSTALL) $(MANFROM) dhclient.leases.cat5 $(MANTO) \ $(DESTDIR)$(FFMANDIR)/dhclient.leases$(FFMANEXT) --- 65,75 ---- $(CHMOD) 700 $(DESTDIR)$(ETC)/dhclient-script; \ fi ! $(MANINSTALL) $(MANFROM) dhclient.$(MANCAT)8 $(MANTO) \ $(DESTDIR)$(ADMMANDIR)/dhclient$(ADMMANEXT) ! $(MANINSTALL) $(MANFROM) dhclient-script.$(MANCAT)8 $(MANTO) \ $(DESTDIR)$(ADMMANDIR)/dhclient-script$(ADMMANEXT) ! $(MANINSTALL) $(MANFROM) dhclient.conf.$(MANCAT)5 $(MANTO) \ $(DESTDIR)$(FFMANDIR)/dhclient.conf$(FFMANEXT) ! $(MANINSTALL) $(MANFROM) dhclient.leases.$(MANCAT)5 $(MANTO) \ $(DESTDIR)$(FFMANDIR)/dhclient.leases$(FFMANEXT) diff -rNc2 dhcp-2.0b1pl18/client/clparse.c dhcp-2.0b1pl25/client/clparse.c *** dhcp-2.0b1pl18/client/clparse.c Fri Jul 10 16:17:00 1998 --- dhcp-2.0b1pl25/client/clparse.c Mon Mar 29 13:21:37 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: clparse.c,v 1.13.2.2 1998/07/10 23:17:00 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: clparse.c,v 1.13.2.4 1999/03/29 21:21:37 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 49,56 **** #include "dhctoken.h" - static TIME parsed_time; - struct client_config top_level_config; - u_int32_t requested_lease_time; /* client-conf-file :== client-declarations EOF --- 49,53 ---- *************** *** 64,70 **** char *val; int token; - int declaration = 0; struct client_config *config; - struct client_state *state; struct interface_info *ip; --- 61,65 ---- *************** *** 82,87 **** top_level_config.reboot_timeout = 10; top_level_config.retry_interval = 300; ! top_level_config.backoff_cutoff = 120; ! top_level_config.initial_interval = 10; top_level_config.bootp_policy = ACCEPT; top_level_config.script_name = "/etc/dhclient-script"; --- 77,82 ---- top_level_config.reboot_timeout = 10; top_level_config.retry_interval = 300; ! top_level_config.backoff_cutoff = 15; ! top_level_config.initial_interval = 3; top_level_config.bootp_policy = ACCEPT; top_level_config.script_name = "/etc/dhclient-script"; *************** *** 107,115 **** [top_level_config.requested_option_count++] = DHO_HOST_NAME; - requested_lease_time = 7200; - top_level_config.send_options [DHO_DHCP_LEASE_TIME].data - = (unsigned char *)&requested_lease_time; - top_level_config.send_options [DHO_DHCP_LEASE_TIME].len - = sizeof requested_lease_time; if ((cfile = fopen (path_dhclient_conf, "r")) != NULL) { --- 102,105 ---- *************** *** 334,338 **** char *val; int len; - u_int8_t *s; token = peek_token (&val, cfile); --- 324,327 ---- *************** *** 428,434 **** char *val; ! struct interface_info dummy_interface, *ip; ! struct client_state dummy_state; ! struct client_config dummy_config; token = next_token (&val, cfile); --- 417,421 ---- char *val; ! struct interface_info *ip; token = next_token (&val, cfile); *************** *** 665,669 **** int token; char *val; - char *t, *n; struct interface_info *ip; --- 652,655 ---- *************** *** 811,819 **** /* Parse the option data... */ do { - /* Set a flag if this is an array of a simple type (i.e., - not an array of pairs of IP addresses, or something - like that. */ - int uniform = option -> format [1] == 'A'; - for (fmt = option -> format; *fmt; fmt++) { if (*fmt == 'A') --- 797,800 ---- diff -rNc2 dhcp-2.0b1pl18/client/dhclient-script.8 dhcp-2.0b1pl25/client/dhclient-script.8 *** dhcp-2.0b1pl18/client/dhclient-script.8 Sat Feb 27 13:41:42 1999 --- dhcp-2.0b1pl25/client/dhclient-script.8 Mon Mar 29 14:05:33 1999 *************** *** 36,40 **** .\" see ``http://www.isc.org/isc''. To learn more about Vixie .\" Enterprises, see ``http://www.vix.com''. ! .TH dhclient 8 .SH NAME dhclient-script - DHCP client network configuration script --- 36,40 ---- .\" see ``http://www.isc.org/isc''. To learn more about Vixie .\" Enterprises, see ``http://www.vix.com''. ! .TH dhclient-script 8 .SH NAME dhclient-script - DHCP client network configuration script *************** *** 48,60 **** any, and also called once if no valid lease can be identified. .PP ! 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 .B ETCDIR/dhclient.conf ! script. If you find that you can't make such a customization without ! customizing dhclient-script, please submit a bug report. .SH OPERATION When dhclient needs to invoke the client configuration script, it --- 48,94 ---- any, and also called once if no valid lease can be identified. .PP ! This script is not meant to be customized by the end user. If local ! customizations are needed, they should be possible 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 ! .B /etc/resolv.conf ! file. ! .PP ! No standard client script exists for some operating systems, even though ! the actual client may work, 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 ! .B ETCDIR/dhclient.conf ! 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 ! When it starts, the client script first defines a shell function, ! .B make_resolv_conf , ! which is later used to create the ! .B /etc/resolv.conf ! file. To override the default behaviour, redefine this function in ! the enter hook script. ! .PP ! On after defining the make_resolv_conf function, the client script checks ! for the presence of an executable ! .B ETCDIR/dhclient-enter-hooks ! script, and if present, it invokes the script inline, using the Bourne ! shell '.' command. The entire environment documented under OPERATION ! is available to this script, which may modify the environment 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 ! .B ETCDIR/dhclient-script ! will exit with that error code immediately after the client script exits. ! .PP ! After all processing has completed, ! .B ETCDIR/dhclient-script ! checks for the presence of an executable ! .B ETCDIR/dhclient-exit-hooks ! script, which if present is invoked using the '.' command. The exit status ! is passed in the exit_status shell variable, and will always be zero if the ! script succeeded at the task for which it was invoked. .SH OPERATION When dhclient needs to invoke the client configuration script, it diff -rNc2 dhcp-2.0b1pl18/client/dhclient.c dhcp-2.0b1pl25/client/dhclient.c *** dhcp-2.0b1pl18/client/dhclient.c Fri Mar 5 08:13:54 1999 --- dhcp-2.0b1pl25/client/dhclient.c Fri Apr 9 10:42:05 1999 *************** *** 57,61 **** #ifndef lint static char ocopyright[] = ! "$Id: dhclient.c,v 1.44.2.25 1999/03/05 16:13:54 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 57,61 ---- #ifndef lint static char ocopyright[] = ! "$Id: dhclient.c,v 1.44.2.35 1999/04/09 17:42:05 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 93,101 **** "Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium."; static char arr [] = "All rights reserved."; ! static char message [] = "Internet Software Consortium DHCP Client V2.0b1pl18"; ! static char contrib [] = "\nPlease contribute if you find this software useful."; ! static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html\n"; ! static void usage PROTO ((void)); int main (argc, argv, envp) --- 93,101 ---- "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.0b1pl25"; ! 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"; ! static void usage PROTO ((char *)); int main (argc, argv, envp) *************** *** 108,117 **** int seed; int quiet = 0; #ifdef SYSLOG_4_2 ! openlog ("dhclient", LOG_NDELAY); ! log_priority = LOG_DAEMON; #else ! openlog ("dhclient", LOG_NDELAY, LOG_DAEMON); #endif --- 108,125 ---- int seed; int quiet = 0; + char *s; + s = strchr (argv [0], '/'); + if (!s) + s = argv [0]; + else + s++; + + /* Initially, log errors to stderr as well as to syslogd. */ #ifdef SYSLOG_4_2 ! openlog (s, LOG_NDELAY); ! log_priority = DHCPD_LOG_FACILITY; #else ! openlog (s, LOG_NDELAY, DHCPD_LOG_FACILITY); #endif *************** *** 123,127 **** if (!strcmp (argv [i], "-p")) { if (++i == argc) ! usage (); local_port = htons (atoi (argv [i])); debug ("binding to user-specified port %d", --- 131,135 ---- if (!strcmp (argv [i], "-p")) { if (++i == argc) ! usage (s); local_port = htons (atoi (argv [i])); debug ("binding to user-specified port %d", *************** *** 131,137 **** } else if (!strcmp (argv [i], "-D")) { save_scripts = 1; } else if (!strcmp (argv [i], "-lf")) { if (++i == argc) ! usage (); path_dhclient_db = argv [i]; } else if (!strcmp (argv [i], "-q")) { --- 139,149 ---- } else if (!strcmp (argv [i], "-D")) { save_scripts = 1; + } else if (!strcmp (argv [i], "-pf")) { + if (++i == argc) + usage (s); + path_dhclient_pid = argv [i]; } else if (!strcmp (argv [i], "-lf")) { if (++i == argc) ! usage (s); path_dhclient_db = argv [i]; } else if (!strcmp (argv [i], "-q")) { *************** *** 139,143 **** quiet_interface_discovery = 1; } else if (argv [i][0] == '-') { ! usage (); } else { struct interface_info *tmp = --- 151,155 ---- quiet_interface_discovery = 1; } else if (argv [i][0] == '-') { ! usage (s); } else { struct interface_info *tmp = *************** *** 160,165 **** --- 172,179 ---- note (copyright); note (arr); + note (""); note (contrib); note (url); + note (""); } *************** *** 267,273 **** } ! static void usage () { ! error ("Usage: dhclient [-c] [-p ] [-lf lease-file] [interface]"); } --- 281,297 ---- } ! static void usage (appname) ! char *appname; { ! note (message); ! note (copyright); ! note (arr); ! note (""); ! note (contrib); ! note (url); ! note (""); ! ! warn ("Usage: %s [-c] [-p ] [-lf lease-file]", appname); ! error (" [-pf pidfile] [interface]"); } *************** *** 461,465 **** struct interface_info *ip = packet -> interface; struct client_lease *lease; - int i; /* If we're not receptive to an offer right now, or if the offer --- 485,488 ---- *************** *** 470,474 **** --- 493,499 ---- (memcmp (packet -> interface -> hw_address.haddr, packet -> raw -> chaddr, packet -> raw -> hlen))) { + #if defined (DEBUG) debug ("DHCPACK in wrong transaction."); + #endif return; } *************** *** 478,482 **** --- 503,509 ---- ip -> client -> state != S_RENEWING && ip -> client -> state != S_REBINDING) { + #if defined (DEBUG) debug ("DHCPACK in wrong state."); + #endif return; } *************** *** 701,705 **** char *name = (packet -> options [DHO_DHCP_MESSAGE_TYPE].len ? "DHCPOFFER" : "BOOTREPLY"); - struct iaddrlist *ap; #ifdef DEBUG_PACKET --- 728,731 ---- *************** *** 715,719 **** --- 741,747 ---- (memcmp (packet -> interface -> hw_address.haddr, packet -> raw -> chaddr, packet -> raw -> hlen))) { + #if defined (DEBUG) debug ("%s in wrong transaction.", name); + #endif return; } *************** *** 918,922 **** --- 946,952 ---- (memcmp (packet -> interface -> hw_address.haddr, packet -> raw -> chaddr, packet -> raw -> hlen))) { + #if defined (DEBUG) debug ("DHCPNAK in wrong transaction."); + #endif return; } *************** *** 926,930 **** --- 956,962 ---- ip -> client -> state != S_RENEWING && ip -> client -> state != S_REBINDING) { + #if defined (DEBUG) debug ("DHCPNAK in wrong state."); + #endif return; } *************** *** 1034,1041 **** /* Record the number of seconds since we started sending. */ ! if (interval < 255) ! ip -> client -> packet.secs = interval; else ! ip -> client -> packet.secs = 255; note ("DHCPDISCOVER on %s to %s port %d interval %ld", --- 1066,1074 ---- /* Record the number of seconds since we started sending. */ ! if (interval < 65536) ! ip -> client -> packet.secs = htons (interval); else ! ip -> client -> packet.secs = htons (65535); ! ip -> client -> secs = ip -> client -> packet.secs; note ("DHCPDISCOVER on %s to %s port %d interval %ld", *************** *** 1277,1284 **** /* Record the number of seconds since we started sending. */ ! if (interval < 255) ! ip -> client -> packet.secs = interval; ! else ! ip -> client -> packet.secs = 255; note ("DHCPREQUEST on %s to %s port %d", ip -> name, --- 1310,1321 ---- /* Record the number of seconds since we started sending. */ ! if (ip -> client -> state == S_REQUESTING) ! ip -> client -> packet.secs = ip -> client -> secs; ! else { ! if (interval < 65536) ! ip -> client -> packet.secs = htons (interval); ! else ! ip -> client -> packet.secs = htons (65535); ! } note ("DHCPREQUEST on %s to %s port %d", ip -> name, *************** *** 1348,1352 **** struct client_lease *lease; { - struct dhcp_packet *raw; unsigned char discover = DHCPDISCOVER; int i; --- 1385,1388 ---- *************** *** 1410,1415 **** /* Set up the option buffer... */ ip -> client -> packet_length = ! cons_options ((struct packet *)0, &ip -> client -> packet, ! options, 0, 0, 0); if (ip -> client -> packet_length < BOOTP_MIN_LEN) ip -> client -> packet_length = BOOTP_MIN_LEN; --- 1446,1451 ---- /* Set up the option buffer... */ ip -> client -> packet_length = ! cons_options ((struct packet *)0, &ip -> client -> packet, 0, ! options, 0, 0, 0, (u_int8_t *)0, 0); if (ip -> client -> packet_length < BOOTP_MIN_LEN) ip -> client -> packet_length = BOOTP_MIN_LEN; *************** *** 1421,1425 **** ip -> client -> packet.xid = random (); ip -> client -> packet.secs = 0; /* filled in by send_discover. */ ! ip -> client -> packet.flags = htons (BOOTP_BROADCAST); /* XXX */ memset (&(ip -> client -> packet.ciaddr), 0, sizeof ip -> client -> packet.ciaddr); --- 1457,1466 ---- ip -> client -> packet.xid = random (); ip -> client -> packet.secs = 0; /* filled in by send_discover. */ ! ! if (can_receive_unicast_unconfigured (ip)) ! ip -> client -> packet.flags = 0; ! else ! ip -> client -> packet.flags = htons (BOOTP_BROADCAST); ! memset (&(ip -> client -> packet.ciaddr), 0, sizeof ip -> client -> packet.ciaddr); *************** *** 1517,1522 **** /* Set up the option buffer... */ ip -> client -> packet_length = ! cons_options ((struct packet *)0, &ip -> client -> packet, ! options, 0, 0, 0); if (ip -> client -> packet_length < BOOTP_MIN_LEN) ip -> client -> packet_length = BOOTP_MIN_LEN; --- 1558,1563 ---- /* Set up the option buffer... */ ip -> client -> packet_length = ! cons_options ((struct packet *)0, &ip -> client -> packet, 0, ! options, 0, 0, 0, (u_int8_t *)0, 0); if (ip -> client -> packet_length < BOOTP_MIN_LEN) ip -> client -> packet_length = BOOTP_MIN_LEN; *************** *** 1540,1544 **** memset (&ip -> client -> packet.ciaddr, 0, sizeof ip -> client -> packet.ciaddr); ! ip -> client -> packet.flags = htons (BOOTP_BROADCAST); } --- 1581,1588 ---- memset (&ip -> client -> packet.ciaddr, 0, sizeof ip -> client -> packet.ciaddr); ! if (can_receive_unicast_unconfigured (ip)) ! ip -> client -> packet.flags = 0; ! else ! ip -> client -> packet.flags = htons (BOOTP_BROADCAST); } *************** *** 1618,1623 **** /* Set up the option buffer... */ ip -> client -> packet_length = ! cons_options ((struct packet *)0, &ip -> client -> packet, ! options, 0, 0, 0); if (ip -> client -> packet_length < BOOTP_MIN_LEN) ip -> client -> packet_length = BOOTP_MIN_LEN; --- 1662,1667 ---- /* Set up the option buffer... */ ip -> client -> packet_length = ! cons_options ((struct packet *)0, &ip -> client -> packet, 0, ! options, 0, 0, 0, (u_int8_t *)0, 0); if (ip -> client -> packet_length < BOOTP_MIN_LEN) ip -> client -> packet_length = BOOTP_MIN_LEN; *************** *** 1629,1633 **** ip -> client -> packet.xid = ip -> client -> xid; ip -> client -> packet.secs = 0; /* Filled in by send_request. */ ! ip -> client -> packet.flags = htons (BOOTP_BROADCAST); /* ciaddr must always be zero. */ --- 1673,1677 ---- ip -> client -> packet.xid = ip -> client -> xid; ip -> client -> packet.secs = 0; /* Filled in by send_request. */ ! ip -> client -> packet.flags = 0; /* ciaddr must always be zero. */ *************** *** 1658,1662 **** struct tree_cache *options [256]; struct tree_cache message_type_tree; - struct tree_cache requested_address_tree; struct tree_cache server_id_tree; --- 1702,1705 ---- *************** *** 1684,1689 **** /* Set up the option buffer... */ ip -> client -> packet_length = ! cons_options ((struct packet *)0, &ip -> client -> packet, ! options, 0, 0, 0); if (ip -> client -> packet_length < BOOTP_MIN_LEN) ip -> client -> packet_length = BOOTP_MIN_LEN; --- 1727,1732 ---- /* Set up the option buffer... */ ip -> client -> packet_length = ! cons_options ((struct packet *)0, &ip -> client -> packet, 0, ! options, 0, 0, 0, (u_int8_t *)0, 0); if (ip -> client -> packet_length < BOOTP_MIN_LEN) ip -> client -> packet_length = BOOTP_MIN_LEN; *************** *** 1696,1701 **** ip -> client -> packet.secs = 0; ip -> client -> packet.flags = 0; ! memcpy (&ip -> client -> packet.ciaddr, ! lease -> address.iabuf, lease -> address.len); memset (&ip -> client -> packet.yiaddr, 0, sizeof ip -> client -> packet.yiaddr); --- 1739,1745 ---- ip -> client -> packet.secs = 0; ip -> client -> packet.flags = 0; ! ! memset (&ip -> client -> packet.ciaddr, 0, ! sizeof ip -> client -> packet.ciaddr); memset (&ip -> client -> packet.yiaddr, 0, sizeof ip -> client -> packet.yiaddr); *************** *** 1993,1997 **** if (len > sizeof dbuf) { warn ("no space to %s %s", ! "prepend option", dhcp_options [i].name); goto supersede; --- 2037,2041 ---- if (len > sizeof dbuf) { warn ("no space to %s %s", ! "append option", dhcp_options [i].name); goto supersede; *************** *** 1999,2010 **** dp = dbuf; memcpy (dp, ip -> client -> config -> defaults [i].data, ip -> client -> config -> defaults [i].len); - memcpy (dp + ip -> client -> - config -> defaults [i].len, - lease -> options [i].data, - lease -> options [i].len); } } else { --- 2043,2053 ---- dp = dbuf; memcpy (dp, + lease -> options [i].data, + lease -> options [i].len); + memcpy (dp + lease -> options [i].len, ip -> client -> config -> defaults [i].data, ip -> client -> config -> defaults [i].len); } } else { diff -rNc2 dhcp-2.0b1pl18/client/dhclient.conf.5 dhcp-2.0b1pl25/client/dhclient.conf.5 *** dhcp-2.0b1pl18/client/dhclient.conf.5 Fri Nov 21 23:10:15 1997 --- dhcp-2.0b1pl25/client/dhclient.conf.5 Fri Mar 26 08:38:50 1999 *************** *** 260,265 **** [\fB,\fI ... \fIoption declaration\fR ]\fB}\fR .PP ! 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 .B prepend --- 260,265 ---- [\fB,\fI ... \fIoption declaration\fR ]\fB}\fR .PP ! 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 .B prepend *************** *** 267,271 **** .B prepend statement can only be used for options which ! allow more than one value to be given. .PP .I The --- 267,272 ---- .B prepend 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. .PP .I The *************** *** 276,287 **** [\fB,\fI ... \fIoption declaration\fR ]\fB}\fR .PP ! 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 .B append statement. The .B append statement can only be used for options which ! allow more than one value to be given. .SH LEASE DECLARATIONS .PP --- 277,289 ---- [\fB,\fI ... \fIoption declaration\fR ]\fB}\fR .PP ! 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 .B append statement. The .B append 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. .SH LEASE DECLARATIONS .PP diff -rNc2 dhcp-2.0b1pl18/client/scripts/bsdos dhcp-2.0b1pl25/client/scripts/bsdos *** dhcp-2.0b1pl18/client/scripts/bsdos Fri Jul 10 16:07:32 1998 --- dhcp-2.0b1pl25/client/scripts/bsdos Mon Mar 29 13:52:34 1999 *************** *** 1,4 **** --- 1,32 ---- #!/bin/sh + make_resolv_conf() { + echo search $new_domain_name >/etc/resolv.conf + for nameserver in $new_domain_name_servers; do + echo nameserver $nameserver >>/etc/resolv.conf + done + } + + # Must be used on exit. Invokes the local dhcp client exit hooks, if any. + exit_with_hooks() { + exit_status=$1 + if [ -x /etc/dhclient-exit-hooks ]; then + . /etc/dhclient-exit-hooks + fi + # probably should do something with exit status of the local script + exit $exit_status + } + + # Invoke the local dhcp client enter hooks, if they exist. + if [ -x /etc/dhclient-enter-hooks ]; then + exit_status=0 + . /etc/dhclient-enter-hooks + # allow the local script to abort processing of this state + # local script must set exit_status variable to nonzero. + if [ $exit_status -ne 0 ]; then + exit $exit_status + fi + fi + if [ x$new_network_number != x ]; then echo New Network Number: $new_network_number *************** *** 26,30 **** ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1 sleep 1 ! exit 0 fi --- 54,58 ---- ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1 sleep 1 ! exit_with_hooks 0 fi *************** *** 36,44 **** ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \ broadcast 255.255.255.255 up ! exit 0 fi if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then ! exit 0; fi --- 64,72 ---- ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \ broadcast 255.255.255.255 up ! exit_with_hooks 0 fi if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then ! exit_with_hooks 0; fi *************** *** 90,94 **** echo nameserver $nameserver >>/etc/resolv.conf done ! exit 0 fi --- 118,122 ---- echo nameserver $nameserver >>/etc/resolv.conf done ! exit_with_hooks 0 fi *************** *** 118,122 **** route add $alias_ip_address 127.0.0.1 fi ! exit 0 fi --- 146,150 ---- route add $alias_ip_address 127.0.0.1 fi ! exit_with_hooks 0 fi *************** *** 154,158 **** fi mv /etc/resolv.conf.std /etc/resolv.conf ! exit 0 fi fi --- 182,186 ---- fi mv /etc/resolv.conf.std /etc/resolv.conf ! exit_with_hooks 0 fi fi *************** *** 170,175 **** arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \ |sh >/dev/null 2>&1 ! exit 1 fi ! exit 0 --- 198,203 ---- arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \ |sh >/dev/null 2>&1 ! exit_with_hooks 1 fi ! exit_with_hooks 0 diff -rNc2 dhcp-2.0b1pl18/client/scripts/freebsd dhcp-2.0b1pl25/client/scripts/freebsd *** dhcp-2.0b1pl18/client/scripts/freebsd Fri Jul 10 16:07:33 1998 --- dhcp-2.0b1pl25/client/scripts/freebsd Mon Mar 29 13:51:53 1999 *************** *** 1,4 **** --- 1,32 ---- #!/bin/sh + make_resolv_conf() { + echo search $new_domain_name >/etc/resolv.conf + for nameserver in $new_domain_name_servers; do + echo nameserver $nameserver >>/etc/resolv.conf + done + } + + # Must be used on exit. Invokes the local dhcp client exit hooks, if any. + exit_with_hooks() { + exit_status=$1 + if [ -x /etc/dhclient-exit-hooks ]; then + . /etc/dhclient-exit-hooks + fi + # probably should do something with exit status of the local script + exit $exit_status + } + + # Invoke the local dhcp client enter hooks, if they exist. + if [ -x /etc/dhclient-enter-hooks ]; then + exit_status=0 + . /etc/dhclient-enter-hooks + # allow the local script to abort processing of this state + # local script must set exit_status variable to nonzero. + if [ $exit_status -ne 0 ]; then + exit $exit_status + fi + fi + if [ x$new_network_number != x ]; then echo New Network Number: $new_network_number *************** *** 26,30 **** ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1 sleep 1 ! exit 0 fi --- 54,58 ---- ifconfig $interface inet -alias 0.0.0.0 $medium >/dev/null 2>&1 sleep 1 ! exit_with_hooks 0 fi *************** *** 36,44 **** ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \ broadcast 255.255.255.255 up ! exit 0 fi if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then ! exit 0; fi --- 64,72 ---- ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \ broadcast 255.255.255.255 up ! exit_with_hooks 0 fi if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then ! exit_with_hooks 0; fi *************** *** 90,94 **** echo nameserver $nameserver >>/etc/resolv.conf done ! exit 0 fi --- 118,122 ---- echo nameserver $nameserver >>/etc/resolv.conf done ! exit_with_hooks 0 fi *************** *** 118,122 **** route add $alias_ip_address 127.0.0.1 fi ! exit 0 fi --- 146,150 ---- route add $alias_ip_address 127.0.0.1 fi ! exit_with_hooks 0 fi *************** *** 154,158 **** fi mv /etc/resolv.conf.std /etc/resolv.conf ! exit 0 fi fi --- 182,186 ---- fi mv /etc/resolv.conf.std /etc/resolv.conf ! exit_with_hooks 0 fi fi *************** *** 170,175 **** arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \ |sh >/dev/null 2>&1 ! exit 1 fi ! exit 0 --- 198,203 ---- arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \ |sh >/dev/null 2>&1 ! exit_with_hooks 1 fi ! exit_with_hooks 0 diff -rNc2 dhcp-2.0b1pl18/client/scripts/netbsd dhcp-2.0b1pl25/client/scripts/netbsd *** dhcp-2.0b1pl18/client/scripts/netbsd Fri Mar 5 08:27:40 1999 --- dhcp-2.0b1pl25/client/scripts/netbsd Mon Mar 29 13:47:08 1999 *************** *** 1,5 **** #!/bin/sh ! function make_resolv_conf() { echo search $new_domain_name >/etc/resolv.conf for nameserver in $new_domain_name_servers; do --- 1,5 ---- #!/bin/sh ! make_resolv_conf() { echo search $new_domain_name >/etc/resolv.conf for nameserver in $new_domain_name_servers; do *************** *** 9,13 **** # Must be used on exit. Invokes the local dhcp client exit hooks, if any. ! function exit_with_hooks() { exit_status=$1 if [ -x /etc/dhclient-exit-hooks ]; then --- 9,13 ---- # Must be used on exit. Invokes the local dhcp client exit hooks, if any. ! exit_with_hooks() { exit_status=$1 if [ -x /etc/dhclient-exit-hooks ]; then diff -rNc2 dhcp-2.0b1pl18/client/scripts/solaris dhcp-2.0b1pl25/client/scripts/solaris *** dhcp-2.0b1pl18/client/scripts/solaris Tue Feb 23 13:52:53 1999 --- dhcp-2.0b1pl25/client/scripts/solaris Mon Mar 29 13:50:23 1999 *************** *** 1,4 **** --- 1,32 ---- #!/bin/sh + make_resolv_conf() { + echo search $new_domain_name >/etc/resolv.conf + for nameserver in $new_domain_name_servers; do + echo nameserver $nameserver >>/etc/resolv.conf + done + } + + # Must be used on exit. Invokes the local dhcp client exit hooks, if any. + exit_with_hooks() { + exit_status=$1 + if [ -x /etc/dhclient-exit-hooks ]; then + . /etc/dhclient-exit-hooks + fi + # probably should do something with exit status of the local script + exit $exit_status + } + + # Invoke the local dhcp client enter hooks, if they exist. + if [ -x /etc/dhclient-enter-hooks ]; then + exit_status=0 + . /etc/dhclient-enter-hooks + # allow the local script to abort processing of this state + # local script must set exit_status variable to nonzero. + if [ $exit_status -ne 0 ]; then + exit $exit_status + fi + fi + if [ x$new_broadcast_address != x ]; then new_broadcast_arg="broadcast $new_broadcast_address" *************** *** 28,32 **** $ifconfig $interface sleep 1 ! exit 0 fi --- 56,60 ---- $ifconfig $interface sleep 1 ! exit_with_hooks 0 fi *************** *** 45,53 **** broadcast 255.255.255.255 up fi ! exit 0 fi if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then ! exit 0; fi --- 73,81 ---- broadcast 255.255.255.255 up fi ! exit_with_hooks 0 fi if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then ! exit_with_hooks 0; fi *************** *** 65,69 **** route delete default $router >/dev/null 2>&1 done - arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' |sh fi if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \ --- 93,96 ---- *************** *** 85,89 **** echo nameserver $nameserver >>/etc/resolv.conf done ! exit 0 fi --- 112,116 ---- echo nameserver $nameserver >>/etc/resolv.conf done ! exit_with_hooks 0 fi *************** *** 99,104 **** route delete default $router >/dev/null 2>&1 done - arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \ - |sh >/dev/null 2>&1 fi if [ x$alias_ip_address != x ]; then --- 126,129 ---- *************** *** 106,110 **** route add $alias_ip_address 127.0.0.1 1 fi ! exit 0 fi --- 131,135 ---- route add $alias_ip_address 127.0.0.1 1 fi ! exit_with_hooks 0 fi *************** *** 136,140 **** ln /etc/resolv.conf.std /etc/resolv.conf fi ! exit 0 fi $ifconfig $interface inet 0 down --- 161,165 ---- ln /etc/resolv.conf.std /etc/resolv.conf fi ! exit_with_hooks 0 fi $ifconfig $interface inet 0 down *************** *** 142,149 **** route delete default $router >/dev/null 2>&1 done ! arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -n -d \1/p' \ ! |sh >/dev/null 2>&1 ! exit 1 fi ! exit 0 --- 167,172 ---- route delete default $router >/dev/null 2>&1 done ! exit_with_hooks 1 fi ! exit_with_hooks 0 diff -rNc2 dhcp-2.0b1pl18/common/Makefile.dist dhcp-2.0b1pl25/common/Makefile.dist *** dhcp-2.0b1pl18/common/Makefile.dist Tue Feb 23 10:09:36 1999 --- dhcp-2.0b1pl25/common/Makefile.dist Tue Apr 6 08:32:21 1999 *************** *** 62,66 **** done; \ done ! $(MANINSTALL) $(MANFROM) dhcp-options.cat5 $(MANTO) \ $(DESTDIR)$(FFMANDIR)/dhcp-options$(FFMANEXT) --- 62,66 ---- done; \ done ! $(MANINSTALL) $(MANFROM) dhcp-options.$(MANCAT)5 $(MANTO) \ $(DESTDIR)$(FFMANDIR)/dhcp-options$(FFMANEXT) diff -rNc2 dhcp-2.0b1pl18/common/alloc.c dhcp-2.0b1pl25/common/alloc.c *** dhcp-2.0b1pl18/common/alloc.c Tue Nov 24 14:17:15 1998 --- dhcp-2.0b1pl25/common/alloc.c Fri Mar 26 08:39:36 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: alloc.c,v 1.13.2.1 1998/11/24 22:17:15 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: alloc.c,v 1.13.2.2 1999/03/26 16:39:36 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 241,244 **** --- 241,246 ---- char *name; { + if (ptr -> prl) + dfree (ptr -> prl, name); ptr -> next = free_lease_states; free_lease_states = ptr; diff -rNc2 dhcp-2.0b1pl18/common/bpf.c dhcp-2.0b1pl25/common/bpf.c *** dhcp-2.0b1pl18/common/bpf.c Tue Feb 23 14:09:56 1999 --- dhcp-2.0b1pl25/common/bpf.c Mon Mar 29 14:07:12 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: bpf.c,v 1.19.2.8 1999/02/23 22:09:56 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 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 */ *************** *** 415,418 **** --- 415,424 ---- int can_unicast_without_arp () + { + return 1; + } + + int can_receive_unicast_unconfigured (ip) + struct interface_info *ip; { return 1; diff -rNc2 dhcp-2.0b1pl18/common/conflex.c dhcp-2.0b1pl25/common/conflex.c *** dhcp-2.0b1pl18/common/conflex.c Mon Feb 8 20:49:04 1999 --- dhcp-2.0b1pl25/common/conflex.c Tue Apr 6 07:58:55 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: conflex.c,v 1.29.2.3 1999/02/09 04:49:04 mellon Exp $ Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: conflex.c,v 1.29.2.4 1999/04/06 14:58:55 mellon Exp $ Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 355,358 **** --- 355,360 ---- switch (tolower (atom [0])) { case 'a': + if (!strcasecmp (atom + 1, "lways-reply-rfc1048")) + return ALWAYS_REPLY_RFC1048; if (!strcasecmp (atom + 1, "ppend")) return APPEND; diff -rNc2 dhcp-2.0b1pl18/common/dhcp-options.5 dhcp-2.0b1pl25/common/dhcp-options.5 *** dhcp-2.0b1pl18/common/dhcp-options.5 Sun Dec 20 10:22:59 1998 --- dhcp-2.0b1pl25/common/dhcp-options.5 Thu Apr 8 14:37:16 1999 *************** *** 104,110 **** .nf .sp 1 ! option client-identifier "CLIENT-FOO"; or ! option client-identifier 43:4c:49:45:54:2d:46:4f:4f; .fi .PP --- 104,110 ---- .nf .sp 1 ! option dhcp-client-identifier "CLIENT-FOO"; or ! option dhcp-client-identifier 43:4c:49:45:54:2d:46:4f:4f; .fi .PP diff -rNc2 dhcp-2.0b1pl18/common/dispatch.c dhcp-2.0b1pl25/common/dispatch.c *** dhcp-2.0b1pl18/common/dispatch.c Tue Feb 23 09:37:00 1999 --- dhcp-2.0b1pl25/common/dispatch.c Mon Mar 29 14:16:36 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: dispatch.c,v 1.47.2.12 1999/02/23 17:37:00 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: dispatch.c,v 1.47.2.14 1999/03/29 22:16:36 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 75,79 **** int i; int sock; - int address_count = 0; struct subnet *subnet; struct shared_network *share; --- 75,78 ---- *************** *** 357,360 **** --- 356,362 ---- /* ignore tunnel interfaces. */ #endif + #ifdef HAVE_ARPHRD_ROSE + case ARPHRD_ROSE: + #endif #ifdef HAVE_ARPHRD_LOOPBACK case ARPHRD_LOOPBACK: *************** *** 369,373 **** break; ! #ifndef ARPHRD_IEEE802 # define ARPHRD_IEEE802 HTYPE_IEEE802 #endif --- 371,375 ---- break; ! #ifndef HAVE_ARPHRD_IEEE802 # define ARPHRD_IEEE802 HTYPE_IEEE802 #endif *************** *** 378,382 **** break; ! #ifndef ARPHRD_FDDI # define ARPHRD_FDDI HTYPE_FDDI #endif --- 380,384 ---- break; ! #ifndef HAVE_ARPHRD_FDDI # define ARPHRD_FDDI HTYPE_FDDI #endif *************** *** 395,401 **** #endif default: ! error ("%s: unknown hardware address type %d", ifr.ifr_name, sa.sa_family); } } --- 397,420 ---- #endif + #ifdef HAVE_ARPHRD_AX25 + case ARPHRD_AX25: + tmp -> hw_address.hlen = 6; + tmp -> hw_address.htype = ARPHRD_AX25; + memcpy (tmp -> hw_address.haddr, sa.sa_data, 6); + break; + #endif + + #ifdef HAVE_ARPHRD_NETROM + case ARPHRD_NETROM: + tmp -> hw_address.hlen = 6; + tmp -> hw_address.htype = ARPHRD_NETROM; + memcpy (tmp -> hw_address.haddr, sa.sa_data, 6); + break; + #endif + default: ! warn ("%s: unknown hardware address type %d", ifr.ifr_name, sa.sa_family); + break; } } diff -rNc2 dhcp-2.0b1pl18/common/dlpi.c dhcp-2.0b1pl25/common/dlpi.c *** dhcp-2.0b1pl18/common/dlpi.c Sun Feb 28 09:10:52 1999 --- dhcp-2.0b1pl25/common/dlpi.c Mon Mar 29 14:07:13 1999 *************** *** 1248,1251 **** --- 1248,1257 ---- } + int can_receive_unicast_unconfigured (ip) + struct interface_info *ip; + { + return 1; + } + void maybe_setup_fallback () { diff -rNc2 dhcp-2.0b1pl18/common/hash.c dhcp-2.0b1pl25/common/hash.c *** dhcp-2.0b1pl18/common/hash.c Thu Jun 25 14:11:29 1998 --- dhcp-2.0b1pl25/common/hash.c Fri Apr 9 10:39:41 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: hash.c,v 1.9.2.1 1998/06/25 21:11:29 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: hash.c,v 1.9.2.3 1999/04/09 17:39:41 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 68,88 **** register unsigned char *s = name; int i = len; ! if (i) { ! while (i--) { ! /* Add the character in... */ ! accum += *s++; ! /* Add carry back in... */ ! while (accum > 255) { ! accum = (accum & 255) + (accum >> 8); ! } ! } ! } else { ! while (*s) { ! /* Add the character in... */ ! accum += *s++; ! /* Add carry back in... */ ! while (accum > 255) { ! accum = (accum & 255) + (accum >> 8); ! } } } --- 68,77 ---- register unsigned char *s = name; int i = len; ! while (i--) { ! /* Add the character in... */ ! accum += *s++; ! /* Add carry back in... */ ! while (accum > 255) { ! accum = (accum & 255) + (accum >> 8); } } *************** *** 101,104 **** --- 90,95 ---- if (!table) return; + if (!len) + len = strlen ((char *)name); hashno = do_hash (name, len, table -> hash_count); *************** *** 126,129 **** --- 117,122 ---- if (!table) return; + if (!len) + len = strlen ((char *)name); hashno = do_hash (name, len, table -> hash_count); *************** *** 158,175 **** if (!table) return (unsigned char *)0; hashno = do_hash (name, len, table -> hash_count); ! if (len) { ! for (bp = table -> buckets [hashno]; bp; bp = bp -> next) { ! if (len == bp -> len ! && !memcmp (bp -> name, name, len)) ! return bp -> value; ! } ! } else { ! for (bp = table -> buckets [hashno]; bp; bp = bp -> next) ! if (!strcmp ((char *)bp -> name, (char *)name)) ! return bp -> value; } return (unsigned char *)0; } - --- 151,164 ---- if (!table) return (unsigned char *)0; + + if (!len) + len = strlen ((char *)name); + hashno = do_hash (name, len, table -> hash_count); ! for (bp = table -> buckets [hashno]; bp; bp = bp -> next) { ! if (len == bp -> len && !memcmp (bp -> name, name, len)) ! return bp -> value; } return (unsigned char *)0; } diff -rNc2 dhcp-2.0b1pl18/common/icmp.c dhcp-2.0b1pl25/common/icmp.c *** dhcp-2.0b1pl18/common/icmp.c Thu Jun 25 14:11:29 1998 --- dhcp-2.0b1pl25/common/icmp.c Mon Mar 29 15:20:00 1999 *************** *** 44,48 **** #ifndef lint static char copyright[] = ! "$Id: icmp.c,v 1.7.2.1 1998/06/25 21:11:29 mellon Exp $ Copyright (c) 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 44,48 ---- #ifndef lint static char copyright[] = ! "$Id: icmp.c,v 1.7.2.2 1999/03/29 23:20:00 mellon Exp $ Copyright (c) 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 62,67 **** struct protoent *proto; int protocol = 1; - struct sockaddr_in from; - int fd; int state; --- 62,65 ---- diff -rNc2 dhcp-2.0b1pl18/common/inet.c dhcp-2.0b1pl25/common/inet.c *** dhcp-2.0b1pl18/common/inet.c Fri Nov 21 16:45:55 1997 --- dhcp-2.0b1pl25/common/inet.c Mon Mar 29 15:19:37 1999 *************** *** 115,119 **** struct iaddr mask; { ! int i, j, k; struct iaddr rv; --- 115,119 ---- struct iaddr mask; { ! int i; struct iaddr rv; diff -rNc2 dhcp-2.0b1pl18/common/lpf.c dhcp-2.0b1pl25/common/lpf.c *** dhcp-2.0b1pl18/common/lpf.c Tue Feb 23 14:09:55 1999 --- dhcp-2.0b1pl25/common/lpf.c Mon Mar 29 14:07:13 1999 *************** *** 44,48 **** #ifndef lint static char copyright[] = ! "$Id: lpf.c,v 1.1.2.6 1999/02/23 22:09:55 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 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 */ *************** *** 93,100 **** if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || ! errno == EAFNOSUPPORT) ! error ("socket: %m - make sure %s %s!", ! "CONFIG_PACKET and CONFIG_FILTER are defined", "in your kernel configuration"); error("Open a socket for LPF: %m"); } --- 93,102 ---- if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || ! errno == EAFNOSUPPORT || errno == EINVAL) { ! warn ("socket: %m"); ! error ("Make sure to set %s %s!", ! "CONFIG_PACKET=y and CONFIG_FILTER=y", "in your kernel configuration"); + } error("Open a socket for LPF: %m"); } *************** *** 107,114 **** if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || ! errno == EAFNOSUPPORT) ! error ("socket: %m - make sure %s %s!", ! "CONFIG_PACKET and CONFIG_FILTER are defined", "in your kernel configuration"); error("Bind socket to interface: %m"); } --- 109,118 ---- if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || ! errno == EAFNOSUPPORT || errno == EINVAL) { ! warn ("bind: %m"); ! error ("Set %s %s!", ! "CONFIG_PACKET=y and CONFIG_FILTER=y", "in your kernel configuration"); + } error("Bind socket to interface: %m"); } *************** *** 277,280 **** --- 281,290 ---- int can_unicast_without_arp () + { + return 1; + } + + int can_receive_unicast_unconfigured (ip) + struct interface_info *ip; { return 1; diff -rNc2 dhcp-2.0b1pl18/common/nit.c dhcp-2.0b1pl25/common/nit.c *** dhcp-2.0b1pl18/common/nit.c Tue Feb 23 14:09:54 1999 --- dhcp-2.0b1pl25/common/nit.c Mon Mar 29 14:07:14 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: nit.c,v 1.15.2.3 1999/02/23 22:09:54 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: nit.c,v 1.15.2.4 1999/03/29 22:07:14 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 357,360 **** --- 357,366 ---- int can_unicast_without_arp () + { + return 1; + } + + int can_receive_unicast_unconfigured (ip) + struct interface_info *ip; { return 1; diff -rNc2 dhcp-2.0b1pl18/common/options.c dhcp-2.0b1pl25/common/options.c *** dhcp-2.0b1pl18/common/options.c Thu Jun 25 14:11:30 1998 --- dhcp-2.0b1pl25/common/options.c Mon Mar 29 18:57:47 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: options.c,v 1.26.2.3 1998/06/25 21:11:30 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: 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 */ *************** *** 120,124 **** space for it and copy it there. */ if (!packet -> options [code].data) { ! if (!(t = (unsigned char *)malloc (len + 1))) error ("Can't allocate storage for option %s.", dhcp_options [code].name); --- 120,125 ---- space for it and copy it there. */ if (!packet -> options [code].data) { ! if (!(t = ((unsigned char *) ! dmalloc (len + 1, "parse_option_buffer")))) error ("Can't allocate storage for option %s.", dhcp_options [code].name); *************** *** 133,140 **** we last saw. This is really only required for clients, but what the heck... */ ! t = (unsigned char *) ! malloc (len ! + packet -> options [code].len ! + 1); if (!t) error ("Can't expand storage for option %s.", --- 134,140 ---- we last saw. This is really only required for clients, but what the heck... */ ! t = ((unsigned char *) ! dmalloc (len + packet -> options [code].len + 1, ! "parse_option_buffer")); if (!t) error ("Can't expand storage for option %s.", *************** *** 146,150 **** packet -> options [code].len += len; t [packet -> options [code].len] = 0; ! free (packet -> options [code].data); packet -> options [code].data = t; } --- 146,151 ---- packet -> options [code].len += len; t [packet -> options [code].len] = 0; ! dfree (packet -> options [code].data, ! "parse_option_buffer"); packet -> options [code].data = t; } *************** *** 158,168 **** of vendor options using the same routine. */ ! int cons_options (inpacket, outpacket, options, overload, terminate, bootpp) struct packet *inpacket; struct dhcp_packet *outpacket; struct tree_cache **options; int overload; /* Overload flags that may be set. */ int terminate; int bootpp; { unsigned char priority_list [300]; --- 159,173 ---- of vendor options using the same routine. */ ! int cons_options (inpacket, outpacket, mms, ! options, overload, terminate, bootpp, prl, prl_len) struct packet *inpacket; struct dhcp_packet *outpacket; + int mms; struct tree_cache **options; int overload; /* Overload flags that may be set. */ int terminate; int bootpp; + u_int8_t *prl; + int prl_len; { unsigned char priority_list [300]; *************** *** 179,197 **** /* XXX if a BOOTP client specifies a max message size, we will honor it. */ ! if (inpacket && inpacket -> options [DHO_DHCP_MAX_MESSAGE_SIZE].data) { ! main_buffer_size = ! (getUShort (inpacket -> options ! [DHO_DHCP_MAX_MESSAGE_SIZE].data) ! - DHCP_FIXED_LEN); ! /* Enforce a minimum packet size... */ ! if (main_buffer_size < (576 - DHCP_FIXED_LEN)) ! main_buffer_size = 576 - DHCP_FIXED_LEN; ! if (main_buffer_size > sizeof buffer) ! main_buffer_size = sizeof buffer; ! } else if (bootpp) main_buffer_size = 64; else main_buffer_size = 576 - DHCP_FIXED_LEN; /* Preload the option priority list with mandatory options. */ priority_len = 0; --- 184,210 ---- /* XXX if a BOOTP client specifies a max message size, we will honor it. */ ! if (!mms && ! inpacket && ! inpacket -> options [DHO_DHCP_MAX_MESSAGE_SIZE].data && ! (inpacket -> options [DHO_DHCP_MAX_MESSAGE_SIZE].len >= ! sizeof (u_int16_t))) ! mms = getUShort (inpacket -> options ! [DHO_DHCP_MAX_MESSAGE_SIZE].data); ! ! /* If the client has provided a maximum DHCP message size, ! use that; otherwise, if it's BOOTP, only 64 bytes; otherwise ! use up to the minimum IP MTU size (576 bytes). */ ! /* XXX if a BOOTP client specifies a max message size, we will ! honor it. */ ! if (mms) ! main_buffer_size = mms - DHCP_FIXED_LEN; ! else if (bootpp) main_buffer_size = 64; else main_buffer_size = 576 - DHCP_FIXED_LEN; + if (main_buffer_size > sizeof buffer) + main_buffer_size = sizeof buffer; + /* Preload the option priority list with mandatory options. */ priority_len = 0; *************** *** 213,219 **** memcpy (&priority_list [priority_len], ! inpacket -> options ! [DHO_DHCP_PARAMETER_REQUEST_LIST].data, prlen); priority_len += prlen; } else { memcpy (&priority_list [priority_len], --- 226,240 ---- memcpy (&priority_list [priority_len], ! (inpacket -> options ! [DHO_DHCP_PARAMETER_REQUEST_LIST].data), prlen); priority_len += prlen; + prl = priority_list; + } else if (prl) { + if (prl_len + priority_len > sizeof priority_list) + prl_len = (sizeof priority_list) - priority_len; + + memcpy (&priority_list [priority_len], prl, prl_len); + priority_len += prl_len; + prl = priority_list; } else { memcpy (&priority_list [priority_len], *************** *** 583,586 **** --- 604,608 ---- { struct packet tp; + int i; if (packet -> hlen > sizeof packet -> chaddr) { *************** *** 606,609 **** --- 628,637 ---- else bootp (&tp); + + /* Free the data associated with the options. */ + for (i = 0; i < 256; i++) { + if (tp.options [i].len && tp.options [i].data) + dfree (tp.options [i].data, "do_packet"); + } } diff -rNc2 dhcp-2.0b1pl18/common/packet.c dhcp-2.0b1pl25/common/packet.c *** dhcp-2.0b1pl18/common/packet.c Fri Jun 26 11:20:44 1998 --- dhcp-2.0b1pl25/common/packet.c Fri Mar 26 08:52:39 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: packet.c,v 1.18.2.1 1998/06/26 18:20:44 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.2 1999/03/26 16:52:39 mellon Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 195,199 **** header and the data. */ - #if 0 udp.uh_sum = wrapsum (checksum ((unsigned char *)&udp, sizeof udp, --- 195,198 ---- *************** *** 201,209 **** checksum ((unsigned char *) &ip.ip_src, ! sizeof ip.ip_src, IPPROTO_UDP + (u_int32_t) ntohs (udp.uh_ulen))))); - #endif /* Copy the udp header into the buffer... */ --- 200,207 ---- checksum ((unsigned char *) &ip.ip_src, ! 2 * sizeof ip.ip_src, IPPROTO_UDP + (u_int32_t) ntohs (udp.uh_ulen))))); /* Copy the udp header into the buffer... */ *************** *** 252,255 **** --- 250,255 ---- u_int32_t ip_len = (buf [bufix] & 0xf) << 2; u_int32_t sum, usum; + static int packets_seen; + static int packets_bad_checksum; ip = (struct ip *)(buf + bufix); *************** *** 268,273 **** /* Check the IP header checksum - it should be zero. */ if (wrapsum (checksum (buf + bufix, ip_len, 0))) { ! note ("Bad IP checksum: %x", ! wrapsum (checksum (buf + bufix, sizeof *ip, 0))); return -1; } --- 268,275 ---- /* Check the IP header checksum - it should be zero. */ if (wrapsum (checksum (buf + bufix, ip_len, 0))) { ! if (packets_seen && ! (++packets_seen / ++packets_bad_checksum) < 2) ! note ("Bad IP checksum: %x", ! wrapsum (checksum (buf + bufix, sizeof *ip, 0))); return -1; } *************** *** 285,289 **** } - #if 0 usum = udp -> uh_sum; udp -> uh_sum = 0; --- 287,290 ---- *************** *** 293,297 **** checksum ((unsigned char *) &ip -> ip_src, ! sizeof ip -> ip_src, IPPROTO_UDP + (u_int32_t) --- 294,298 ---- checksum ((unsigned char *) &ip -> ip_src, ! 2 * sizeof ip -> ip_src, IPPROTO_UDP + (u_int32_t) *************** *** 299,306 **** if (usum && usum != sum) { ! note ("Bad udp checksum: %x %x", usum, sum); return -1; } - #endif /* Copy out the port... */ --- 300,310 ---- if (usum && usum != sum) { ! static int packets_seen; ! static int packets_bad_checksum; ! if (packets_seen && ! (++packets_seen / ++packets_bad_checksum) < 2) ! note ("Bad udp checksum: %x %x", usum, sum); return -1; } /* Copy out the port... */ diff -rNc2 dhcp-2.0b1pl18/common/parse.c dhcp-2.0b1pl25/common/parse.c *** dhcp-2.0b1pl18/common/parse.c Tue Dec 22 14:43:22 1998 --- dhcp-2.0b1pl25/common/parse.c Mon Mar 29 14:18:53 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: parse.c,v 1.2.2.3 1998/12/22 22:43:22 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: parse.c,v 1.2.2.4 1999/03/29 22:18:53 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 193,199 **** struct iaddr *addr; { - char *val; - int token; - addr -> len = 4; if (parse_numeric_aggregate (cfile, addr -> iabuf, --- 193,196 ---- diff -rNc2 dhcp-2.0b1pl18/common/raw.c dhcp-2.0b1pl25/common/raw.c *** dhcp-2.0b1pl18/common/raw.c Tue Feb 23 14:09:54 1999 --- dhcp-2.0b1pl25/common/raw.c Tue Apr 6 09:00:24 1999 *************** *** 55,59 **** #ifndef lint static char copyright[] = ! "$Id: raw.c,v 1.11.2.2 1999/02/23 22:09:54 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 55,59 ---- #ifndef lint static char copyright[] = ! "$Id: raw.c,v 1.11.2.3 1999/04/06 16:00:24 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 82,85 **** --- 82,86 ---- note ("Sending on %s, port %d", piaddr (info -> address), htons (local_port)); + if ((sock = socket (AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) error ("Can't create dhcp socket: %m"); *************** *** 105,109 **** } ! size_t send_packet (interface, packet, raw, len, from, to, hto) struct interface_info *interface; struct packet *packet; --- 106,110 ---- } ! ssize_t send_packet (interface, packet, raw, len, from, to, hto) struct interface_info *interface; struct packet *packet; *************** *** 114,118 **** struct hardware *hto; { ! unsigned char buf [256]; int bufp = 0; struct iovec iov [2]; --- 115,119 ---- struct hardware *hto; { ! unsigned char buf [1500]; int bufp = 0; struct iovec iov [2]; *************** *** 123,137 **** to -> sin_addr.s_addr, to -> sin_port, (unsigned char *)raw, len); ! ! /* Fire it off */ ! iov [0].iov_base = (char *)buf; ! iov [0].iov_len = bufp; ! iov [1].iov_base = (char *)raw; ! iov [1].iov_len = len; ! ! result = writev(interface -> wfdesc, iov, 2); if (result < 0) warn ("send_packet: %m"); return result; } ! #endif /* USE_SOCKET_SEND */ --- 124,153 ---- to -> sin_addr.s_addr, to -> sin_port, (unsigned char *)raw, len); ! if (len + bufp > sizeof buf) { ! warn ("send_packet: packet too large (%s)", len + bufp); ! return; ! } ! memcpy (buf + bufp, raw, len); ! bufp += len; ! result = sendto (interface -> wfdesc, (char *)buf, bufp, 0, ! (struct sockaddr *)to, sizeof *to); if (result < 0) warn ("send_packet: %m"); return result; } ! ! int can_unicast_without_arp () ! { ! return 1; ! } ! ! void maybe_setup_fallback () ! { ! } ! ! void if_reinitialize_send (info) ! struct interface_info *info; ! { ! } ! ! #endif /* USE_RAW_SEND */ diff -rNc2 dhcp-2.0b1pl18/common/socket.c dhcp-2.0b1pl25/common/socket.c *** dhcp-2.0b1pl18/common/socket.c Tue Feb 23 14:09:55 1999 --- dhcp-2.0b1pl25/common/socket.c Mon Mar 29 14:07:14 1999 *************** *** 51,55 **** #ifndef lint static char copyright[] = ! "$Id: socket.c,v 1.26.2.10 1999/02/23 22:09:55 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 51,55 ---- #ifndef lint static char copyright[] = ! "$Id: socket.c,v 1.26.2.11 1999/03/29 22:07:14 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 268,271 **** --- 268,281 ---- { return 0; + } + + int can_receive_unicast_unconfigured (ip) + struct interface_info *ip; + { + #if defined (SOCKET_CAN_RECEIVE_UNICAST_UNCONFIGURED) + return 1; + #else + return 0; + #endif } diff -rNc2 dhcp-2.0b1pl18/common/upf.c dhcp-2.0b1pl25/common/upf.c *** dhcp-2.0b1pl18/common/upf.c Tue Feb 23 14:09:56 1999 --- dhcp-2.0b1pl25/common/upf.c Mon Mar 29 14:07:13 1999 *************** *** 1,5 **** /* upf.c ! Ultrix PacketFilter interface code. /* --- 1,5 ---- /* upf.c ! Ultrix PacketFilter interface code. */ /* *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: upf.c,v 1.3.2.3 1999/02/23 22:09:56 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: upf.c,v 1.3.2.5 1999/03/29 22:07:13 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 308,311 **** --- 308,317 ---- int can_unicast_without_arp () + { + return 1; + } + + int can_receive_unicast_unconfigured (ip) + struct interface_info *ip; { return 1; diff -rNc2 dhcp-2.0b1pl18/configure dhcp-2.0b1pl25/configure *** dhcp-2.0b1pl18/configure Wed Feb 3 10:53:36 1999 --- dhcp-2.0b1pl25/configure Fri Mar 26 08:28:14 1999 *************** *** 8,11 **** --- 8,13 ---- if [ "$sysname" = "" ]; then case $uname in + AIX) + sysname=aix;; Rhapsody) sysname=rhapsody;; *************** *** 59,62 **** --- 61,65 ---- echo echo "Supported configurations are:" + echo " aix AIX 4.1.5.0" echo " ultrix ULTRIX 4.2A or higher" echo " bsdos BSDI BSD/OS 2.1" diff -rNc2 dhcp-2.0b1pl18/includes/cf/aix.h dhcp-2.0b1pl25/includes/cf/aix.h *** dhcp-2.0b1pl18/includes/cf/aix.h Wed Dec 31 16:00:00 1969 --- dhcp-2.0b1pl25/includes/cf/aix.h Fri Mar 26 08:56:44 1999 *************** *** 0 **** --- 1,89 ---- + /* aix.h */ + /* + * Copyright (c) 1996 The Internet Software Consortium. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of The Internet Software Consortium nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND + * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTERNET SOFTWARE CONSORTIUM OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + #define int8_t char + #define int16_t short + #define int32_t long + + #define u_int8_t unsigned char + #define u_int16_t unsigned short + #define u_int32_t unsigned long + + #include + + #include + + #include + #include + #include + #include + #include + #include + #include + #include + + extern int h_errno; + + #include + #include + #include + + #ifndef _PATH_DHCPD_PID + #define _PATH_DHCPD_PID "/etc/dhcpd.pid" + #endif + #ifndef _PATH_DHCLIENT_PID + #define _PATH_DHCLIENT_PID "/etc/dhclient.pid" + #endif + #ifndef _PATH_DHCRELAY_PID + #define _PATH_DHCRELAY_PID "/etc/dhcrelay.pid" + #endif + + #include + #define VA_DOTDOTDOT va_alist + #define VA_start(list, last) va_start (list) + + #define vsnprintf(buf, size, fmt, list) vsprintf (buf, fmt, list) + #define NO_SNPRINTF + + #define EOL '\n' + #define VOIDPTR void * + + #include + + #define TIME time_t + #define GET_TIME(x) time ((x)) + + #define random rand + + #define USE_SOCKETS 1 + #define HAVE_SA_LEN 1 + #undef FDDI diff -rNc2 dhcp-2.0b1pl18/includes/cf/irix.h dhcp-2.0b1pl25/includes/cf/irix.h *** dhcp-2.0b1pl18/includes/cf/irix.h Wed Dec 31 16:00:00 1969 --- dhcp-2.0b1pl25/includes/cf/irix.h Tue Apr 6 09:00:24 1999 *************** *** 0 **** --- 1,93 ---- + /* irix.h */ + /* + * Copyright (c) 1996 The Internet Software Consortium. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of The Internet Software Consortium nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND + * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTERNET SOFTWARE CONSORTIUM OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + #define int8_t char + #define int16_t short + #define int32_t long + + #define u_int8_t unsigned char + #define u_int16_t unsigned short + #define u_int32_t unsigned long + + #include + + #include + + #include + #include + #include + #include + #include + #include + #include + #include + + extern int h_errno; + + #include + #include + + #define _PATH_DHCPD_CONF "/usr/local/etc/dhcpd.conf" + #define _PATH_DHCPD_DB "/usr/local/etc/dhcp/dhcpd.leases" + + #ifndef _PATH_DHCPD_PID + #define _PATH_DHCPD_PID "/etc/dhcpd.pid" + #endif + #ifndef _PATH_DHCLIENT_PID + #define _PATH_DHCLIENT_PID "/etc/dhclient.pid" + #endif + #ifndef _PATH_DHCRELAY_PID + #define _PATH_DHCRELAY_PID "/etc/dhcrelay.pid" + #endif + + #include + #define VA_DOTDOTDOT ... + #define VA_start(list, last) va_start (list, last) + #define va_dcl + + #define vsnprintf(buf, size, fmt, list) vsprintf (buf, fmt, list) + #define NO_SNPRINTF + + #if defined (USE_DEFAULT_NETWORK) + # define USE_RAW_SEND + # define USE_SOCKET_RECEIVE + #endif + + #define EOL '\n' + #define VOIDPTR void * + + #include + + #define TIME time_t + #define GET_TIME(x) time ((x)) + + #define random rand diff -rNc2 dhcp-2.0b1pl18/includes/cf/qnx.h dhcp-2.0b1pl25/includes/cf/qnx.h *** dhcp-2.0b1pl18/includes/cf/qnx.h Fri Nov 21 23:52:41 1997 --- dhcp-2.0b1pl25/includes/cf/qnx.h Mon Mar 29 14:23:32 1999 *************** *** 87,90 **** --- 87,91 ---- typedef unsigned short u_int16_t; typedef unsigned long u_int32_t; + typedef signed char int8_t; typedef signed short int16_t; typedef signed long int32_t; *************** *** 100,103 **** --- 101,111 ---- #define NO_SNPRINTF #undef AF_LINK + + #ifndef LITTLE_ENDIAN + #define LITTLE_ENDIAN 1234 + #endif + #ifndef BYTE_ORDER + #define BYTE_ORDER LITTLE_ENDIAN + #endif /* diff -rNc2 dhcp-2.0b1pl18/includes/dhcpd.h dhcp-2.0b1pl25/includes/dhcpd.h *** dhcp-2.0b1pl18/includes/dhcpd.h Mon Feb 8 20:53:37 1999 --- dhcp-2.0b1pl25/includes/dhcpd.h Tue Apr 6 08:02:18 1999 *************** *** 161,164 **** --- 161,168 ---- struct iaddr from; + int max_message_size; + u_int8_t *prl; + int prl_len; + u_int32_t xid; u_int16_t secs; *************** *** 210,213 **** --- 214,218 ---- int use_lease_addr_for_default_route; int authoritative; + int always_reply_rfc1048; struct tree_cache *options [256]; *************** *** 333,336 **** --- 338,342 ---- struct iaddr destination; /* Where to send packet. */ u_int32_t xid; /* Transaction ID. */ + u_int16_t secs; /* secs value from DHCPDISCOVER. */ TIME first_sending; /* When was first copy sent? */ TIME interval; /* What's the current resend interval? */ *************** *** 458,463 **** void parse_options PROTO ((struct packet *)); void parse_option_buffer PROTO ((struct packet *, unsigned char *, int)); ! int cons_options PROTO ((struct packet *, struct dhcp_packet *, ! struct tree_cache **, int, int, int)); int store_options PROTO ((unsigned char *, int, struct tree_cache **, unsigned char *, int, int, int, int)); --- 464,470 ---- void parse_options PROTO ((struct packet *)); void parse_option_buffer PROTO ((struct packet *, unsigned char *, int)); ! int cons_options PROTO ((struct packet *, struct dhcp_packet *, int, ! struct tree_cache **, int, int, int, ! u_int8_t *, int)); int store_options PROTO ((unsigned char *, int, struct tree_cache **, unsigned char *, int, int, int, int)); *************** *** 675,678 **** --- 682,686 ---- #if defined (USE_SOCKET_SEND) && !defined (USE_SOCKET_FALLBACK) int can_unicast_without_arp PROTO ((void)); + int can_receive_unicast_unconfigured PROTO ((struct interface_info *)); void maybe_setup_fallback PROTO ((void)); #endif *************** *** 699,702 **** --- 707,711 ---- #if defined (USE_BPF_SEND) int can_unicast_without_arp PROTO ((void)); + int can_receive_unicast_unconfigured PROTO ((struct interface_info *)); void maybe_setup_fallback PROTO ((void)); #endif *************** *** 723,726 **** --- 732,736 ---- #if defined (USE_LPF_SEND) int can_unicast_without_arp PROTO ((void)); + int can_receive_unicast_unconfigured PROTO ((struct interface_info *)); void maybe_setup_fallback PROTO ((void)); #endif *************** *** 748,751 **** --- 758,762 ---- #if defined (USE_NIT_SEND) int can_unicast_without_arp PROTO ((void)); + int can_receive_unicast_unconfigured PROTO ((struct interface_info *)); void maybe_setup_fallback PROTO ((void)); #endif *************** *** 768,771 **** --- 779,783 ---- #if defined (USE_DLPI_SEND) int can_unicast_without_arp PROTO ((void)); + int can_receive_unicast_unconfigured PROTO ((struct interface_info *)); void maybe_setup_fallback PROTO ((void)); #endif *************** *** 780,783 **** --- 792,796 ---- struct sockaddr_in *, struct hardware *)); int can_unicast_without_arp PROTO ((void)); + int can_receive_unicast_unconfigured PROTO ((struct interface_info *)); void maybe_setup_fallback PROTO ((void)); #endif diff -rNc2 dhcp-2.0b1pl18/includes/dhctoken.h dhcp-2.0b1pl25/includes/dhctoken.h *** dhcp-2.0b1pl18/includes/dhctoken.h Mon Feb 8 20:51:45 1999 --- dhcp-2.0b1pl25/includes/dhctoken.h Tue Apr 6 08:00:05 1999 *************** *** 129,132 **** --- 129,133 ---- #define AUTHORITATIVE 333 #define TOKEN_NOT 334 + #define ALWAYS_REPLY_RFC1048 335 #define is_identifier(x) ((x) >= FIRST_TOKEN && \ diff -rNc2 dhcp-2.0b1pl18/includes/osdep.h dhcp-2.0b1pl25/includes/osdep.h *** dhcp-2.0b1pl18/includes/osdep.h Sat Feb 27 13:42:25 1999 --- dhcp-2.0b1pl25/includes/osdep.h Tue Apr 6 09:00:24 1999 *************** *** 76,79 **** --- 76,83 ---- #endif + #ifdef aix + # include "cf/aix.h" + #endif + #ifdef bsdi # include "cf/bsdos.h" *************** *** 124,127 **** --- 128,135 ---- #endif + #if defined(IRIX) || defined(__sgi) + # include "cf/irix.h" + #endif + #if !defined (TIME_MAX) # define TIME_MAX 2147483647 *************** *** 248,251 **** --- 256,279 ---- #endif + #if defined (ARPHRD_ROSE) && !defined (HAVE_ARPHRD_ROSE) + # define HAVE_ARPHRD_ROSE + #endif + + #if defined (ARPHRD_IEEE802) && !defined (HAVE_ARPHRD_IEEE802) + # define HAVE_ARPHRD_IEEE802 + #endif + + #if defined (ARPHRD_FDDI) && !defined (HAVE_ARPHRD_FDDI) + # define HAVE_ARPHRD_FDDI + #endif + + #if defined (ARPHRD_AX25) && !defined (HAVE_ARPHRD_AX25) + # define HAVE_ARPHRD_AX25 + #endif + + #if defined (ARPHRD_NETROM) && !defined (HAVE_ARPHRD_NETROM) + # define HAVE_ARPHRD_NETROM + #endif + #if defined (ARPHRD_METRICOM) && !defined (HAVE_ARPHRD_METRICOM) # define HAVE_ARPHRD_METRICOM *************** *** 263,265 **** # define HAVE_AF_LINK #endif - --- 291,292 ---- diff -rNc2 dhcp-2.0b1pl18/relay/Makefile.dist dhcp-2.0b1pl25/relay/Makefile.dist *** dhcp-2.0b1pl18/relay/Makefile.dist Tue Feb 23 10:09:36 1999 --- dhcp-2.0b1pl25/relay/Makefile.dist Tue Apr 6 08:32:22 1999 *************** *** 57,61 **** $(INSTALL) dhcrelay $(DESTDIR)$(BINDIR) $(CHMOD) 755 $(DESTDIR)$(BINDIR)/dhcrelay ! $(MANINSTALL) $(MANFROM) dhcrelay.cat8 $(MANTO) \ $(DESTDIR)$(ADMMANDIR)/dhcrelay$(ADMMANEXT) --- 57,61 ---- $(INSTALL) dhcrelay $(DESTDIR)$(BINDIR) $(CHMOD) 755 $(DESTDIR)$(BINDIR)/dhcrelay ! $(MANINSTALL) $(MANFROM) dhcrelay.$(MANCAT)8 $(MANTO) \ $(DESTDIR)$(ADMMANDIR)/dhcrelay$(ADMMANEXT) diff -rNc2 dhcp-2.0b1pl18/relay/dhcrelay.c dhcp-2.0b1pl25/relay/dhcrelay.c *** dhcp-2.0b1pl18/relay/dhcrelay.c Fri Mar 5 08:13:56 1999 --- dhcp-2.0b1pl25/relay/dhcrelay.c Fri Apr 9 10:42:07 1999 *************** *** 43,52 **** #ifndef lint static char ocopyright [] = ! "$Id: dhcrelay.c,v 1.9.2.21 1999/03/05 16:13:56 mellon Exp $ Copyright (c) 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" ! static void usage PROTO ((void)); TIME cur_time; --- 43,52 ---- #ifndef lint static char ocopyright [] = ! "$Id: dhcrelay.c,v 1.9.2.28 1999/04/09 17:42:07 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 *)); TIME cur_time; *************** *** 77,83 **** "Copyright 1997, 1998, 1999 The Internet Software Consortium."; static char arr [] = "All rights reserved."; ! static char message [] = "Internet Software Consortium DHCP Relay Agent V2.0b1pl18"; ! static char contrib [] = "\nPlease contribute if you find this software useful."; ! static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html\n"; int main (argc, argv, envp) --- 77,83 ---- "Copyright 1997, 1998, 1999 The Internet Software Consortium."; static char arr [] = "All rights reserved."; ! static char message [] = "Internet Software Consortium DHCP Relay Agent V2.0b1pl25"; ! 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"; int main (argc, argv, envp) *************** *** 90,99 **** int no_daemon = 0; int quiet = 0; #ifdef SYSLOG_4_2 ! openlog ("dhcrelay", LOG_NDELAY); ! log_priority = LOG_DAEMON; #else ! openlog ("dhcrelay", LOG_NDELAY, LOG_DAEMON); #endif --- 90,107 ---- int no_daemon = 0; int quiet = 0; + char *s; + s = strchr (argv [0], '/'); + if (!s) + s = argv [0]; + else + s++; + + /* Initially, log errors to stderr as well as to syslogd. */ #ifdef SYSLOG_4_2 ! openlog (s, LOG_NDELAY); ! log_priority = DHCPD_LOG_FACILITY; #else ! openlog (s, LOG_NDELAY, DHCPD_LOG_FACILITY); #endif *************** *** 105,112 **** if (!strcmp (argv [i], "-p")) { if (++i == argc) ! usage (); local_port = htons (atoi (argv [i])); debug ("binding to user-specified port %d", ntohs (local_port)); } else if (!strcmp (argv [i], "-d")) { no_daemon = 1; --- 113,124 ---- if (!strcmp (argv [i], "-p")) { if (++i == argc) ! usage (s); local_port = htons (atoi (argv [i])); debug ("binding to user-specified port %d", ntohs (local_port)); + } else if (!strcmp (argv [i], "-pf")) { + if (++i == argc) + usage (s); + path_dhcrelay_pid = argv [i]; } else if (!strcmp (argv [i], "-d")) { no_daemon = 1; *************** *** 119,123 **** "record interface", argv [i]); if (++i == argc) { ! usage (); } memset (tmp, 0, sizeof *tmp); --- 131,135 ---- "record interface", argv [i]); if (++i == argc) { ! usage (s); } memset (tmp, 0, sizeof *tmp); *************** *** 130,134 **** quiet_interface_discovery = 1; } else if (argv [i][0] == '-') { ! usage (); } else { struct hostent *he; --- 142,146 ---- quiet_interface_discovery = 1; } else if (argv [i][0] == '-') { ! usage (s); } else { struct hostent *he; *************** *** 161,166 **** --- 173,180 ---- note (copyright); note (arr); + note (""); note (contrib); note (url); + note (""); } *************** *** 178,182 **** /* We need at least one server. */ if (!sp) { ! usage (); } --- 192,196 ---- /* We need at least one server. */ if (!sp) { ! usage (s); } *************** *** 337,344 **** } ! static void usage () { ! warn ("Usage: dhcrelay [-i] [-d] [-i if0] [...-i ifN] [-p ]"); ! error (" [server1 [... serverN]]"); } --- 351,367 ---- } ! static void usage (appname) ! char *appname; { ! note (message); ! note (copyright); ! note (arr); ! note (""); ! note (contrib); ! note (url); ! note (""); ! ! warn ("Usage: %s [-i] [-d] [-i if0] [...-i ifN] [-p ]", appname); ! error (" [-pf pidfilename] [server1 [... serverN]]"); } diff -rNc2 dhcp-2.0b1pl18/server/Makefile.dist dhcp-2.0b1pl25/server/Makefile.dist *** dhcp-2.0b1pl18/server/Makefile.dist Tue Feb 23 10:09:36 1999 --- dhcp-2.0b1pl25/server/Makefile.dist Tue Apr 6 08:32:21 1999 *************** *** 57,65 **** $(INSTALL) dhcpd $(DESTDIR)$(BINDIR) $(CHMOD) 755 $(DESTDIR)$(BINDIR)/dhcpd ! $(MANINSTALL) $(MANFROM) dhcpd.cat8 $(MANTO) \ $(DESTDIR)$(ADMMANDIR)/dhcpd$(ADMMANEXT) ! $(MANINSTALL) $(MANFROM) dhcpd.conf.cat5 $(MANTO) \ $(DESTDIR)$(FFMANDIR)/dhcpd.conf$(FFMANEXT) ! $(MANINSTALL) $(MANFROM) dhcpd.leases.cat5 $(MANTO) \ $(DESTDIR)$(FFMANDIR)/dhcpd.leases$(FFMANEXT) --- 57,65 ---- $(INSTALL) dhcpd $(DESTDIR)$(BINDIR) $(CHMOD) 755 $(DESTDIR)$(BINDIR)/dhcpd ! $(MANINSTALL) $(MANFROM) dhcpd.$(MANCAT)8 $(MANTO) \ $(DESTDIR)$(ADMMANDIR)/dhcpd$(ADMMANEXT) ! $(MANINSTALL) $(MANFROM) dhcpd.conf.$(MANCAT)5 $(MANTO) \ $(DESTDIR)$(FFMANDIR)/dhcpd.conf$(FFMANEXT) ! $(MANINSTALL) $(MANFROM) dhcpd.leases.$(MANCAT)5 $(MANTO) \ $(DESTDIR)$(FFMANDIR)/dhcpd.leases$(FFMANEXT) diff -rNc2 dhcp-2.0b1pl18/server/bootp.c dhcp-2.0b1pl25/server/bootp.c *** dhcp-2.0b1pl18/server/bootp.c Tue Feb 23 09:43:38 1999 --- dhcp-2.0b1pl25/server/bootp.c Thu Apr 8 14:39:34 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: bootp.c,v 1.28.2.3 1999/02/23 17:43:38 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 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 */ *************** *** 68,72 **** return; ! note ("BOOTREQUEST from %s via %s", print_hw_addr (packet -> raw -> htype, packet -> raw -> hlen, --- 68,72 ---- return; ! note ("BOOTREQUEST from %s via %s%s", print_hw_addr (packet -> raw -> htype, packet -> raw -> hlen, *************** *** 74,78 **** packet -> raw -> giaddr.s_addr ? inet_ntoa (packet -> raw -> giaddr) ! : packet -> interface -> name); --- 74,79 ---- packet -> raw -> giaddr.s_addr ? inet_ntoa (packet -> raw -> giaddr) ! : packet -> interface -> name, ! packet -> options_valid ? "" : " (non-rfc1048)"); *************** *** 233,241 **** /* If we didn't get a known vendor magic number on the way in, just copy the input options to the output. */ ! if (!packet -> options_valid) { memcpy (outgoing.raw -> options, packet -> raw -> options, DHCP_OPTION_LEN); outgoing.packet_length = BOOTP_MIN_LEN; } else { /* Come up with a list of options that we want to send to this client. Start with the per-subnet options, --- 234,246 ---- /* If we didn't get a known vendor magic number on the way in, just copy the input options to the output. */ ! if (!packet -> options_valid && ! !subnet -> group -> always_reply_rfc1048 && ! (!hp || !hp -> group -> always_reply_rfc1048)) { memcpy (outgoing.raw -> options, packet -> raw -> options, DHCP_OPTION_LEN); outgoing.packet_length = BOOTP_MIN_LEN; } else { + struct tree_cache netmask_tree; /* -- RBF */ + /* Come up with a list of options that we want to send to this client. Start with the per-subnet options, *************** *** 250,253 **** --- 255,270 ---- } + /* Use the subnet mask from the subnet declaration if no other + mask has been provided. */ + if (!options [DHO_SUBNET_MASK]) { + options [DHO_SUBNET_MASK] = &netmask_tree; + netmask_tree.flags = TC_TEMPORARY; + netmask_tree.value = lease -> subnet -> netmask.iabuf; + netmask_tree.len = lease -> subnet -> netmask.len; + netmask_tree.buf_size = lease -> subnet -> netmask.len; + netmask_tree.timeout = 0xFFFFFFFF; + netmask_tree.tree = (struct tree *)0; + } + /* Pack the options into the buffer. Unlike DHCP, we can't pack options into the filename and server *************** *** 255,259 **** outgoing.packet_length = ! cons_options (packet, outgoing.raw, options, 0, 0, 1); if (outgoing.packet_length < BOOTP_MIN_LEN) outgoing.packet_length = BOOTP_MIN_LEN; --- 272,277 ---- outgoing.packet_length = ! cons_options (packet, outgoing.raw, ! 0, options, 0, 0, 1, (u_int8_t *)0, 0); if (outgoing.packet_length < BOOTP_MIN_LEN) outgoing.packet_length = BOOTP_MIN_LEN; diff -rNc2 dhcp-2.0b1pl18/server/confpars.c dhcp-2.0b1pl25/server/confpars.c *** dhcp-2.0b1pl18/server/confpars.c Tue Feb 16 10:57:33 1999 --- dhcp-2.0b1pl25/server/confpars.c Tue Apr 6 08:18:27 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: confpars.c,v 1.45.2.7 1999/02/16 18:57:33 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 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 */ *************** *** 76,81 **** root_group.authoritative = 1; ! if ((cfile = fopen (path_dhcpd_conf, "r")) == NULL) error ("Can't open %s: %m", path_dhcpd_conf); do { token = peek_token (&val, cfile); --- 76,83 ---- root_group.authoritative = 1; ! if ((cfile = fopen (path_dhcpd_conf, "r")) == NULL) { error ("Can't open %s: %m", path_dhcpd_conf); + } + do { token = peek_token (&val, cfile); *************** *** 114,121 **** thinking that no leases have been assigned to anybody, which could create severe network chaos. */ ! if ((cfile = fopen (path_dhcpd_db, "r")) == NULL) ! error ("Can't open lease database %s: %m -- %s", ! path_dhcpd_db, ! "check for failed database rewrite attempt!"); do { token = next_token (&val, cfile); --- 116,126 ---- thinking that no leases have been assigned to anybody, which could create severe network chaos. */ ! if ((cfile = fopen (path_dhcpd_db, "r")) == NULL) { ! warn ("Can't open lease database %s: %m -- %s", ! path_dhcpd_db, ! "check for failed database rewrite attempt!"); ! warn ("Please read the dhcpd.leases manual page if you."); ! error ("don't know what to do about this."); } ! do { token = next_token (&val, cfile); *************** *** 304,307 **** --- 309,316 ---- parse_warn ("get-lease-hostnames not allowed here."); group -> get_lease_hostnames = parse_boolean (cfile); + break; + + case ALWAYS_REPLY_RFC1048: + group -> always_reply_rfc1048 = parse_boolean (cfile); break; diff -rNc2 dhcp-2.0b1pl18/server/dhcp.c dhcp-2.0b1pl25/server/dhcp.c *** dhcp-2.0b1pl18/server/dhcp.c Fri Mar 5 08:10:56 1999 --- dhcp-2.0b1pl25/server/dhcp.c Thu Apr 8 14:49:45 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: dhcp.c,v 1.57.2.21 1999/03/05 16:10:56 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: dhcp.c,v 1.57.2.25 1999/04/08 21:49:45 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 314,317 **** --- 314,337 ---- } + /* If we're not allowed to serve this client anymore, don't. */ + if (lease && + !lease -> host && + !lease -> subnet -> group -> boot_unknown_clients) { + note ("Ignoring unknown client %s", + print_hw_addr (packet -> raw -> htype, + packet -> raw -> hlen, + packet -> raw -> chaddr)); + return; + } else if (lease && lease -> host && + !lease -> host -> group -> allow_booting) { + note ("Declining to renew client %s", + lease -> host -> name + ? lease -> host -> name + : print_hw_addr (packet -> raw -> htype, + packet -> raw -> hlen, + packet -> raw -> chaddr)); + return; + } + /* If we own the lease that the client is asking for, and it's already been assigned to the client, ack it. */ *************** *** 431,434 **** --- 451,455 ---- struct packet outgoing; struct hardware hto; + int i; struct tree_cache *options [256]; *************** *** 458,468 **** /* Do not use the client's requested parameter list. */ ! packet -> options [DHO_DHCP_PARAMETER_REQUEST_LIST].len = 0; ! packet -> options [DHO_DHCP_PARAMETER_REQUEST_LIST].data = ! (unsigned char *)0; /* Set up the option buffer... */ outgoing.packet_length = ! cons_options (packet, outgoing.raw, options, 0, 0, 0); /* memset (&raw.ciaddr, 0, sizeof raw.ciaddr);*/ --- 479,493 ---- /* Do not use the client's requested parameter list. */ ! i = DHO_DHCP_PARAMETER_REQUEST_LIST; ! if (packet -> options [i].data) { ! packet -> options [i].len = 0; ! dfree (packet -> options [i].data, "nak_lease"); ! packet -> options [i].data = (unsigned char *)0; ! } /* Set up the option buffer... */ outgoing.packet_length = ! cons_options (packet, outgoing.raw, 0, options, 0, 0, 0, ! (u_int8_t *)0, 0); /* memset (&raw.ciaddr, 0, sizeof raw.ciaddr);*/ *************** *** 804,807 **** --- 829,856 ---- 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: */ *************** *** 1111,1115 **** /* Insert such options as will fit into the buffer. */ packet_length = cons_options ((struct packet *)0, &raw, ! state -> options, bufs, nulltp, bootpp); /* Having done the cons_options(), we can release the tree_cache --- 1160,1166 ---- /* 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 *************** *** 1187,1191 **** (struct packet *)0, &raw, packet_length, ! raw.siaddr, &to, &hto); free_lease_state (state, "dhcp_reply fallback 1"); --- 1238,1243 ---- (struct packet *)0, &raw, packet_length, ! raw.siaddr, ! &to, (struct hardware *)0); free_lease_state (state, "dhcp_reply fallback 1"); *************** *** 1194,1205 **** } ! /* If it comes from a client that already knows its address and ! is not requesting a broadcast response, sent it directly to ! that client. */ ! } else if (raw.ciaddr.s_addr && state -> offer == DHCPACK && ! !(raw.flags & htons (BOOTP_BROADCAST)) && ! can_unicast_without_arp ()) { ! to.sin_addr = state -> ciaddr; ! to.sin_port = remote_port; /* XXX */ if (fallback_interface) { --- 1246,1254 ---- } ! /* 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; if (fallback_interface) { *************** *** 1207,1219 **** (struct packet *)0, &raw, packet_length, ! raw.siaddr, &to, &hto); ! free_lease_state (state, "dhcp_reply fallback 1"); lease -> state = (struct lease_state *)0; return; } } else { - /* Otherwise, broadcast it on the local network. */ to.sin_addr.s_addr = htonl (INADDR_BROADCAST); ! to.sin_port = remote_port; /* XXX */ } --- 1256,1280 ---- (struct packet *)0, &raw, packet_length, ! raw.siaddr, &to, ! (struct hardware *)0); ! free_lease_state (state, ! "dhcp_reply fallback 2"); lease -> state = (struct lease_state *)0; return; } + + /* If it comes from a client that already knows its address + and is not requesting a broadcast response, and we can + unicast to a client without using the ARP protocol, sent it + directly to that client. */ + } else if (!(raw.flags & htons (BOOTP_BROADCAST)) && + can_unicast_without_arp ()) { + to.sin_addr = raw.yiaddr; + to.sin_port = remote_port; + + /* Otherwise, broadcast it on the local network. */ } else { to.sin_addr.s_addr = htonl (INADDR_BROADCAST); ! to.sin_port = remote_port; } *************** *** 1238,1242 **** struct host_decl *hp, *host = (struct host_decl *)0; struct lease *fixed_lease; - int i; /* Figure out what IP address the client is requesting, if any. */ --- 1299,1302 ---- diff -rNc2 dhcp-2.0b1pl18/server/dhcpd.c dhcp-2.0b1pl25/server/dhcpd.c *** dhcp-2.0b1pl18/server/dhcpd.c Fri Mar 5 08:13:54 1999 --- dhcp-2.0b1pl25/server/dhcpd.c Fri Apr 9 10:42:07 1999 *************** *** 43,47 **** #ifndef lint static char ocopyright[] = ! "$Id: dhcpd.c,v 1.45.2.18 1999/03/05 16:13:54 mellon Exp $ Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium."; #endif --- 43,47 ---- #ifndef lint static char ocopyright[] = ! "$Id: dhcpd.c,v 1.45.2.26 1999/04/09 17:42:07 mellon Exp $ Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium."; #endif *************** *** 49,59 **** "Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium."; static char arr [] = "All rights reserved."; ! static char message [] = "Internet Software Consortium DHCP Server V2.0b1pl18 "; ! static char contrib [] = "\nPlease contribute if you find this software useful."; ! static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html\n"; #include "dhcpd.h" ! static void usage PROTO ((void)); TIME cur_time; --- 49,59 ---- "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.0b1pl25"; ! 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 *)); TIME cur_time; *************** *** 83,87 **** int i, status; struct servent *ent; ! char *s; int cftest = 0; #ifndef DEBUG --- 83,87 ---- int i, status; struct servent *ent; ! char *s, *appname; int cftest = 0; #ifndef DEBUG *************** *** 93,102 **** int quiet = 0; /* Initially, log errors to stderr as well as to syslogd. */ #ifdef SYSLOG_4_2 ! openlog ("dhcpd", LOG_NDELAY); log_priority = DHCPD_LOG_FACILITY; #else ! openlog ("dhcpd", LOG_NDELAY, DHCPD_LOG_FACILITY); #endif --- 93,108 ---- int quiet = 0; + appname = strchr (argv [0], '/'); + if (!appname) + appname = argv [0]; + else + appname++; + /* Initially, log errors to stderr as well as to syslogd. */ #ifdef SYSLOG_4_2 ! openlog (appname, LOG_NDELAY); log_priority = DHCPD_LOG_FACILITY; #else ! openlog (appname, LOG_NDELAY, DHCPD_LOG_FACILITY); #endif *************** *** 112,116 **** if (!strcmp (argv [i], "-p")) { if (++i == argc) ! usage (); for (s = argv [i]; *s; s++) if (!isdigit (*s)) --- 118,122 ---- if (!strcmp (argv [i], "-p")) { if (++i == argc) ! usage (appname); for (s = argv [i]; *s; s++) if (!isdigit (*s)) *************** *** 135,143 **** } else if (!strcmp (argv [i], "-cf")) { if (++i == argc) ! usage (); path_dhcpd_conf = argv [i]; } else if (!strcmp (argv [i], "-lf")) { if (++i == argc) ! usage (); path_dhcpd_db = argv [i]; } else if (!strcmp (argv [i], "-t")) { --- 141,153 ---- } else if (!strcmp (argv [i], "-cf")) { if (++i == argc) ! usage (appname); path_dhcpd_conf = argv [i]; + } else if (!strcmp (argv [i], "-pf")) { + if (++i == argc) + usage (appname); + path_dhcpd_pid = argv [i]; } else if (!strcmp (argv [i], "-lf")) { if (++i == argc) ! usage (appname); path_dhcpd_db = argv [i]; } else if (!strcmp (argv [i], "-t")) { *************** *** 152,156 **** quiet_interface_discovery = 1; } else if (argv [i][0] == '-') { ! usage (); } else { struct interface_info *tmp = --- 162,166 ---- quiet_interface_discovery = 1; } else if (argv [i][0] == '-') { ! usage (appname); } else { struct interface_info *tmp = *************** *** 172,177 **** --- 182,189 ---- note (copyright); note (arr); + note (""); note (contrib); note (url); + note (""); } *************** *** 285,296 **** /* Print usage message. */ ! static void usage () { note (message); note (copyright); note (arr); ! ! error ("Usage: dhcpd [-p ] [-d] [-f] [-cf config-file]%s", ! "\n [-lf lease-file] [if0 [...ifN]]"); } --- 297,314 ---- /* Print usage message. */ ! static void usage (appname) ! char *appname; { note (message); note (copyright); note (arr); ! note (""); ! note (contrib); ! note (url); ! note (""); ! ! warn ("Usage: %s [-p ] [-d] [-f] [-cf config-file]", ! appname); ! error(" [-lf lease-file] [-pf pidfile] [if0 [...ifN]]"); } diff -rNc2 dhcp-2.0b1pl18/server/dhcpd.conf.5 dhcp-2.0b1pl25/server/dhcpd.conf.5 *** dhcp-2.0b1pl18/server/dhcpd.conf.5 Tue Feb 23 09:49:50 1999 --- dhcp-2.0b1pl25/server/dhcpd.conf.5 Thu Apr 8 14:51:29 1999 *************** *** 516,520 **** .I hardware-address should be a set of hexadecimal octets (numbers from 0 through ff) ! seperated by colons. The \fIhardwarefR statement may also be used for DHCP clients. .PP --- 516,520 ---- .I hardware-address should be a set of hexadecimal octets (numbers from 0 through ff) ! seperated by colons. The \fIhardware\fR statement may also be used for DHCP clients. .PP *************** *** 718,721 **** --- 718,740 ---- machines. Unfortunately, if the opposite happens to be true for you site, you are probably better off not trying to use this flag. + .PP + .B The + .I always-reply-rfc1048 + .B statement + .PP + \fBalways-reply-rfc1048\fR \fIflag\fR\fB;\fR + .PP + 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. + .PP + If you want to send rfc1048 options to such a client, you can set the + .B always-reply-rfc1048 + 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. .PP .B The