diff -rc2 dhcp-2.0b1pl19/README dhcp-2.0b1pl20/README *** dhcp-2.0b1pl19/README Fri Mar 26 09:38:36 1999 --- dhcp-2.0b1pl20/README Mon Mar 29 13:19:21 1999 *************** *** 1,6 **** Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 19 ! March 26, 1998 Documentation for this software includes this README file, the --- 1,6 ---- Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 20 ! March 29, 1998 Documentation for this software includes this README file, the *************** *** 89,95 **** the tar utility and the gzip command - type something like: ! zcat dhcp-2.0b1pl10.tar.gz |tar xvf - ! Now, cd to the dhcp-2.0b1pl19 subdirectory that you've just created and configure the source tree by typing: --- 89,95 ---- the tar utility and the gzip command - type something like: ! zcat dhcp-2.0b1pl20.tar.gz |tar xvf - ! Now, cd to the dhcp-2.0b1pl20 subdirectory that you've just created and configure the source tree by typing: *************** *** 145,158 **** 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 --- 145,163 ---- 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 diff -rc2 dhcp-2.0b1pl19/RELNOTES dhcp-2.0b1pl20/RELNOTES *** dhcp-2.0b1pl19/RELNOTES Fri Mar 26 09:40:05 1999 --- dhcp-2.0b1pl20/RELNOTES Mon Mar 29 14:44:38 1999 *************** *** 1,6 **** Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 19 ! March 26, 1998 Release Notes --- 1,6 ---- Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 20 ! March 29, 1998 Release Notes *************** *** 53,56 **** --- 53,75 ---- 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 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. CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 18 diff -rc2 dhcp-2.0b1pl19/client/clparse.c dhcp-2.0b1pl20/client/clparse.c *** dhcp-2.0b1pl19/client/clparse.c Fri Mar 26 08:33:34 1999 --- dhcp-2.0b1pl20/client/clparse.c Mon Mar 29 13:21:37 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: clparse.c,v 1.13.2.3 1999/03/26 16:33:34 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,54 **** #include "dhctoken.h" - static TIME parsed_time; - struct client_config top_level_config; --- 49,52 ---- *************** *** 63,69 **** char *val; int token; - int declaration = 0; struct client_config *config; - struct client_state *state; struct interface_info *ip; --- 61,65 ---- *************** *** 328,332 **** char *val; int len; - u_int8_t *s; token = peek_token (&val, cfile); --- 324,327 ---- *************** *** 422,428 **** 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); *************** *** 659,663 **** int token; char *val; - char *t, *n; struct interface_info *ip; --- 652,655 ---- *************** *** 805,813 **** /* 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 -rc2 dhcp-2.0b1pl19/client/dhclient-script.8 dhcp-2.0b1pl20/client/dhclient-script.8 *** dhcp-2.0b1pl19/client/dhclient-script.8 Sat Feb 27 13:41:42 1999 --- dhcp-2.0b1pl20/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 -rc2 dhcp-2.0b1pl19/client/dhclient.c dhcp-2.0b1pl20/client/dhclient.c *** dhcp-2.0b1pl19/client/dhclient.c Fri Mar 26 09:39:20 1999 --- dhcp-2.0b1pl20/client/dhclient.c Mon Mar 29 15:13:48 1999 *************** *** 57,61 **** #ifndef lint static char ocopyright[] = ! "$Id: dhclient.c,v 1.44.2.27 1999/03/26 17:39:20 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.29 1999/03/29 23:13:48 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.0b1pl19"; ! 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.0b1pl20"; ! 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 ---- *************** *** 705,709 **** char *name = (packet -> options [DHO_DHCP_MESSAGE_TYPE].len ? "DHCPOFFER" : "BOOTREPLY"); - struct iaddrlist *ap; #ifdef DEBUG_PACKET --- 728,731 ---- *************** *** 1363,1367 **** struct client_lease *lease; { - struct dhcp_packet *raw; unsigned char discover = DHCPDISCOVER; int i; --- 1385,1388 ---- *************** *** 1673,1677 **** struct tree_cache *options [256]; struct tree_cache message_type_tree; - struct tree_cache requested_address_tree; struct tree_cache server_id_tree; --- 1694,1697 ---- diff -rc2 dhcp-2.0b1pl19/client/scripts/bsdos dhcp-2.0b1pl20/client/scripts/bsdos *** dhcp-2.0b1pl19/client/scripts/bsdos Fri Jul 10 16:07:32 1998 --- dhcp-2.0b1pl20/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 -rc2 dhcp-2.0b1pl19/client/scripts/freebsd dhcp-2.0b1pl20/client/scripts/freebsd *** dhcp-2.0b1pl19/client/scripts/freebsd Fri Jul 10 16:07:33 1998 --- dhcp-2.0b1pl20/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 -rc2 dhcp-2.0b1pl19/client/scripts/netbsd dhcp-2.0b1pl20/client/scripts/netbsd *** dhcp-2.0b1pl19/client/scripts/netbsd Fri Mar 5 08:27:40 1999 --- dhcp-2.0b1pl20/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 -rc2 dhcp-2.0b1pl19/client/scripts/solaris dhcp-2.0b1pl20/client/scripts/solaris *** dhcp-2.0b1pl19/client/scripts/solaris Tue Feb 23 13:52:53 1999 --- dhcp-2.0b1pl20/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 -rc2 dhcp-2.0b1pl19/common/bpf.c dhcp-2.0b1pl20/common/bpf.c *** dhcp-2.0b1pl19/common/bpf.c Tue Feb 23 14:09:56 1999 --- dhcp-2.0b1pl20/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 -rc2 dhcp-2.0b1pl19/common/dispatch.c dhcp-2.0b1pl20/common/dispatch.c *** dhcp-2.0b1pl19/common/dispatch.c Fri Mar 26 08:43:02 1999 --- dhcp-2.0b1pl20/common/dispatch.c Mon Mar 29 14:16:36 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: dispatch.c,v 1.47.2.13 1999/03/26 16:43:02 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 ---- *************** *** 140,144 **** except don't skip down interfaces if we're trying to get a list of configurable interfaces. */ ! if (!(ifr.ifr_flags & IFF_BROADCAST) || (!(ifr.ifr_flags & IFF_UP) && state != DISCOVER_UNCONFIGURED)) --- 139,146 ---- except don't skip down interfaces if we're trying to get a list of configurable interfaces. */ ! if ((ifr.ifr_flags & IFF_LOOPBACK) || ! #ifdef HAVE_IFF_POINTOPOINT ! (ifr.ifr_flags & IFF_POINTOPOINT) || ! #endif (!(ifr.ifr_flags & IFF_UP) && state != DISCOVER_UNCONFIGURED)) diff -rc2 dhcp-2.0b1pl19/common/dlpi.c dhcp-2.0b1pl20/common/dlpi.c *** dhcp-2.0b1pl19/common/dlpi.c Sun Feb 28 09:10:52 1999 --- dhcp-2.0b1pl20/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 -rc2 dhcp-2.0b1pl19/common/icmp.c dhcp-2.0b1pl20/common/icmp.c *** dhcp-2.0b1pl19/common/icmp.c Thu Jun 25 14:11:29 1998 --- dhcp-2.0b1pl20/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 -rc2 dhcp-2.0b1pl19/common/inet.c dhcp-2.0b1pl20/common/inet.c *** dhcp-2.0b1pl19/common/inet.c Fri Nov 21 16:45:55 1997 --- dhcp-2.0b1pl20/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 -rc2 dhcp-2.0b1pl19/common/lpf.c dhcp-2.0b1pl20/common/lpf.c *** dhcp-2.0b1pl19/common/lpf.c Fri Mar 26 08:44:12 1999 --- dhcp-2.0b1pl20/common/lpf.c Mon Mar 29 14:07:13 1999 *************** *** 44,48 **** #ifndef lint static char copyright[] = ! "$Id: lpf.c,v 1.1.2.7 1999/03/26 16:44:12 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 || errno == EINVAL) ! 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 || errno == EINVAL) ! 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 -rc2 dhcp-2.0b1pl19/common/nit.c dhcp-2.0b1pl20/common/nit.c *** dhcp-2.0b1pl19/common/nit.c Tue Feb 23 14:09:54 1999 --- dhcp-2.0b1pl20/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 -rc2 dhcp-2.0b1pl19/common/options.c dhcp-2.0b1pl20/common/options.c *** dhcp-2.0b1pl19/common/options.c Fri Mar 26 08:49:44 1999 --- dhcp-2.0b1pl20/common/options.c Mon Mar 29 15:12:55 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: options.c,v 1.26.2.4 1999/03/26 16:49:44 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.6 1999/03/29 23:12:55 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; } *************** *** 605,608 **** --- 606,610 ---- { struct packet tp; + int i; if (packet -> hlen > sizeof packet -> chaddr) { *************** *** 628,631 **** --- 630,639 ---- 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 -rc2 dhcp-2.0b1pl19/common/parse.c dhcp-2.0b1pl20/common/parse.c *** dhcp-2.0b1pl19/common/parse.c Tue Dec 22 14:43:22 1998 --- dhcp-2.0b1pl20/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 -rc2 dhcp-2.0b1pl19/common/socket.c dhcp-2.0b1pl20/common/socket.c *** dhcp-2.0b1pl19/common/socket.c Tue Feb 23 14:09:55 1999 --- dhcp-2.0b1pl20/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 -rc2 dhcp-2.0b1pl19/common/upf.c dhcp-2.0b1pl20/common/upf.c *** dhcp-2.0b1pl19/common/upf.c Fri Mar 26 08:53:50 1999 --- dhcp-2.0b1pl20/common/upf.c Mon Mar 29 14:07:13 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: upf.c,v 1.3.2.4 1999/03/26 16:53:50 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 -rc2 dhcp-2.0b1pl19/includes/cf/qnx.h dhcp-2.0b1pl20/includes/cf/qnx.h *** dhcp-2.0b1pl19/includes/cf/qnx.h Fri Nov 21 23:52:41 1997 --- dhcp-2.0b1pl20/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 -rc2 dhcp-2.0b1pl19/includes/dhcpd.h dhcp-2.0b1pl20/includes/dhcpd.h *** dhcp-2.0b1pl19/includes/dhcpd.h Fri Mar 26 08:55:50 1999 --- dhcp-2.0b1pl20/includes/dhcpd.h Mon Mar 29 15:10:11 1999 *************** *** 681,684 **** --- 681,685 ---- #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 *************** *** 705,708 **** --- 706,710 ---- #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 *************** *** 729,732 **** --- 731,735 ---- #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 *************** *** 754,757 **** --- 757,761 ---- #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 *************** *** 774,777 **** --- 778,782 ---- #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 *************** *** 786,789 **** --- 791,795 ---- 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 -rc2 dhcp-2.0b1pl19/relay/dhcrelay.c dhcp-2.0b1pl20/relay/dhcrelay.c *** dhcp-2.0b1pl19/relay/dhcrelay.c Fri Mar 26 09:39:21 1999 --- dhcp-2.0b1pl20/relay/dhcrelay.c Mon Mar 29 14:25:16 1999 *************** *** 43,52 **** #ifndef lint static char ocopyright [] = ! "$Id: dhcrelay.c,v 1.9.2.22 1999/03/26 17:39:21 mellon Exp $ Copyright (c) 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" ! static void usage PROTO ((void)); TIME cur_time; --- 43,52 ---- #ifndef lint static char ocopyright [] = ! "$Id: dhcrelay.c,v 1.9.2.23 1999/03/29 22:25:16 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.0b1pl19"; ! 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.0b1pl20"; ! 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 -rc2 dhcp-2.0b1pl19/server/confpars.c dhcp-2.0b1pl20/server/confpars.c *** dhcp-2.0b1pl19/server/confpars.c Fri Mar 26 08:59:12 1999 --- dhcp-2.0b1pl20/server/confpars.c Mon Mar 29 14:27:06 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: confpars.c,v 1.45.2.8 1999/03/26 16:59:12 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.9 1999/03/29 22:27:06 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 77,83 **** if ((cfile = fopen (path_dhcpd_conf, "r")) == NULL) { ! warn ("Can't open %s: %m", path_dhcpd_conf); ! warn ("Please read the dhcpd.leases manual page if you."); ! error ("don't know what to do about this."); } --- 77,81 ---- if ((cfile = fopen (path_dhcpd_conf, "r")) == NULL) { ! error ("Can't open %s: %m", path_dhcpd_conf); } *************** *** 118,125 **** 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); diff -rc2 dhcp-2.0b1pl19/server/dhcp.c dhcp-2.0b1pl20/server/dhcp.c *** dhcp-2.0b1pl19/server/dhcp.c Fri Mar 26 09:05:18 1999 --- dhcp-2.0b1pl20/server/dhcp.c Mon Mar 29 14:29:31 1999 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: dhcp.c,v 1.57.2.22 1999/03/26 17:05:18 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.23 1999/03/29 22:29:31 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 314,317 **** --- 314,336 ---- } + /* If we're not allowed to serve this client anymore, don't. */ + if (!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 -> 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. */ *************** *** 1275,1279 **** 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. */ --- 1294,1297 ---- diff -rc2 dhcp-2.0b1pl19/server/dhcpd.c dhcp-2.0b1pl20/server/dhcpd.c *** dhcp-2.0b1pl19/server/dhcpd.c Fri Mar 26 09:39:19 1999 --- dhcp-2.0b1pl20/server/dhcpd.c Mon Mar 29 15:13:15 1999 *************** *** 43,47 **** #ifndef lint static char ocopyright[] = ! "$Id: dhcpd.c,v 1.45.2.19 1999/03/26 17:39:19 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.21 1999/03/29 23:13:15 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.0b1pl19 "; ! 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.0b1pl20"; ! 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]]"); }