diff -rNc2 dhcp-2.0b1pl2/RELNOTES dhcp-2.0b1pl3/RELNOTES *** dhcp-2.0b1pl2/RELNOTES Thu Jun 25 14:22:55 1998 --- dhcp-2.0b1pl3/RELNOTES Thu Jun 25 21:24:22 1998 *************** *** 1,5 **** Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 2 June 25, 1998 --- 1,5 ---- Internet Software Consortium Dynamic Host Configuration Protocol Distribution ! Version 2, Beta 1, Patchlevel 3 June 25, 1998 *************** *** 46,49 **** --- 46,63 ---- 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 2 + + - Allow server-identifier in any scope. Use in-scope server + identifier option rather than the default, if one exists. + + - Delete newlines from abandoned lease reclaimation warning. + + - Only release other applicable leases held by a client when the + client sends a DHCPREQUEST. + + - Fix core dump when find_lease didn't find a lease. + + - Update dhcpd.leases man page. CHANGES FROM VERSION 2.0 BETA 1 PATCHLEVEL 1 diff -rNc2 dhcp-2.0b1pl2/server/confpars.c dhcp-2.0b1pl3/server/confpars.c *** dhcp-2.0b1pl2/server/confpars.c Thu Jun 25 14:11:34 1998 --- dhcp-2.0b1pl3/server/confpars.c Thu Jun 25 15:12:59 1998 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: confpars.c,v 1.45.2.1 1998/06/25 21:11:34 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.2 1998/06/25 22:12:59 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 320,326 **** case SERVER_IDENTIFIER: - if (type != ROOT_GROUP) - parse_warn ("server-identifier only allowed at top %s", - "level."); tree = parse_ip_addr_or_hostname (cfile, 0); if (!tree) --- 320,323 ---- diff -rNc2 dhcp-2.0b1pl2/server/dhcp.c dhcp-2.0b1pl3/server/dhcp.c *** dhcp-2.0b1pl2/server/dhcp.c Thu Jun 25 14:20:41 1998 --- dhcp-2.0b1pl3/server/dhcp.c Thu Jun 25 21:17:12 1998 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: dhcp.c,v 1.57.2.3 1998/06/25 21:20:41 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: dhcp.c,v 1.57.2.5 1998/06/26 04:17:12 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 121,125 **** the administrator will eventually investigate. */ if (lease -> flags & ABANDONED_LEASE) { ! warn ("Reclaiming abandoned IP address %s.\n", piaddr (lease -> ip_addr)); lease -> flags &= ~ABANDONED_LEASE; --- 121,125 ---- the administrator will eventually investigate. */ if (lease -> flags & ABANDONED_LEASE) { ! warn ("Reclaiming abandoned IP address %s.", piaddr (lease -> ip_addr)); lease -> flags &= ~ABANDONED_LEASE; *************** *** 835,846 **** i = DHO_DHCP_SERVER_IDENTIFIER; ! state -> options [i] = new_tree_cache ("server-id"); ! state -> options [i] -> value = ! (unsigned char *)&state -> ip -> primary_address; ! state -> options [i] -> len = ! sizeof state -> ip -> primary_address; ! state -> options [i] -> buf_size = state -> options [i] -> len; ! state -> options [i] -> timeout = 0xFFFFFFFF; ! state -> options [i] -> tree = (struct tree *)0; /* Sanity check the lease time. */ --- 835,850 ---- i = DHO_DHCP_SERVER_IDENTIFIER; ! if (!state -> options [i]) { ! state -> options [i] = new_tree_cache ("server-id"); ! state -> options [i] -> value = ! (unsigned char *)&state -> ! ip -> primary_address; ! state -> options [i] -> len = ! sizeof state -> ip -> primary_address; ! state -> options [i] -> buf_size ! = state -> options [i] -> len; ! state -> options [i] -> timeout = 0xFFFFFFFF; ! state -> options [i] -> tree = (struct tree *)0; ! } /* Sanity check the lease time. */ *************** *** 1340,1344 **** if (ip_lease) { if (lease) { ! release_lease (ip_lease); } else { lease = ip_lease; --- 1344,1349 ---- if (ip_lease) { if (lease) { ! if (packet -> packet_type == DHCPREQUEST) ! release_lease (ip_lease); } else { lease = ip_lease; *************** *** 1352,1356 **** if (uid_lease) { if (lease) { ! release_lease (uid_lease); } else { lease = uid_lease; --- 1357,1362 ---- if (uid_lease) { if (lease) { ! if (packet -> packet_type == DHCPREQUEST) ! release_lease (uid_lease); } else { lease = uid_lease; *************** *** 1362,1366 **** if (hw_lease) { if (lease) { ! release_lease (hw_lease); } else { lease = hw_lease; --- 1368,1373 ---- if (hw_lease) { if (lease) { ! if (packet -> packet_type == DHCPREQUEST) ! release_lease (hw_lease); } else { lease = hw_lease; *************** *** 1385,1390 **** warning message, so that if it continues to lose, the administrator will eventually investigate. */ ! if (lease -> flags & ABANDONED_LEASE) { ! warn ("Reclaiming REQUESTed abandoned IP address %s.\n", piaddr (lease -> ip_addr)); lease -> flags &= ~ABANDONED_LEASE; --- 1392,1397 ---- warning message, so that if it continues to lose, the administrator will eventually investigate. */ ! if (lease && lease -> flags & ABANDONED_LEASE) { ! warn ("Reclaiming REQUESTed abandoned IP address %s.", piaddr (lease -> ip_addr)); lease -> flags &= ~ABANDONED_LEASE; diff -rNc2 dhcp-2.0b1pl2/server/dhcpd.c dhcp-2.0b1pl3/server/dhcpd.c *** dhcp-2.0b1pl2/server/dhcpd.c Sat Dec 6 03:25:32 1997 --- dhcp-2.0b1pl3/server/dhcpd.c Sat Dec 6 03:25:32 1997 *************** *** 49,53 **** "Copyright 1995, 1996 The Internet Software Consortium."; static char arr [] = "All rights reserved."; ! static char message [] = "Internet Software Consortium DHCPD $Name: V2-BETA-1-PATCH-2 $"; #include "dhcpd.h" --- 49,53 ---- "Copyright 1995, 1996 The Internet Software Consortium."; static char arr [] = "All rights reserved."; ! static char message [] = "Internet Software Consortium DHCPD $Name: V2-BETA-1-PATCH-3 $"; #include "dhcpd.h" diff -rNc2 dhcp-2.0b1pl2/server/dhcpd.leases.5 dhcp-2.0b1pl3/server/dhcpd.leases.5 *** dhcp-2.0b1pl2/server/dhcpd.leases.5 Fri Nov 21 22:43:37 1997 --- dhcp-2.0b1pl3/server/dhcpd.leases.5 Thu Jun 25 15:59:54 1998 *************** *** 1,5 **** ! .\" dhcpd.conf.5 .\" ! .\" Copyright (c) 1997 The Internet Software Consortium. .\" All rights reserved. .\" --- 1,5 ---- ! .\" dhcpd.leases.5 .\" ! .\" Copyright (c) 1997, 1998 The Internet Software Consortium. .\" All rights reserved. .\" *************** *** 42,49 **** The Internet Software Consortium DHCP Server keeps a persistent database of leases that it has assigned. This database is a free-form ! ASCII file containing one valid declaration per lease. If more than ! one declaration appears for a given lease, the last one in the file is ! used. The file is written as a log, so this is not an unusual ! occurrance. .PP When dhcpd is first installed, there is no lease database. However, --- 42,49 ---- The Internet Software Consortium DHCP Server keeps a persistent database of leases that it has assigned. This database is a free-form ! ASCII file containing a series of lease declarations. Every time a ! lease is acquired, renewed or released, its new value is recorded at ! the end of the lease file. So if more than one declaration appears ! for a given lease, the last one in the file is the current one. .PP When dhcpd is first installed, there is no lease database. However, *************** *** 69,73 **** file will be restored. .SH FORMAT ! The format of the lease declarations is not currently documented. .SH FILES .B DBDIR/dhcpd.leases --- 69,165 ---- file will be restored. .SH FORMAT ! Lease descriptions are stored in a format that is parsed by the same ! recursive descent parser used to read the ! .B dhcpd.conf(5) ! and ! .B dhclient.conf(5) ! files. Currently, the only declaration that is ! used in the dhcpd.leases file is the ! .B lease ! declaration. ! .PP ! \fBlease \fIip-address\fB { \fIstatements...\fB } ! .PP ! Each lease declaration include the single IP address that has been ! leased to the client. The statements within the braces define the ! duration of the lease and to whom it is assigned. ! .PP ! The start and end time of a lease are recorded using the ``starts'' ! and ``ends'' statements: ! .PP ! \fB starts \fIdate\fB;\fR ! \fB ends \fIdate\fB;\fR ! .PP ! Dates are specified as follows: ! .PP ! \fIweekday year\fB/\fImonth\fB/\fIday ! hour\fB:\fIminute\fB:\fIsecond\fR ! .PP ! The weekday is present to make it easy for a human to tell when a ! lease expires - it's specified as a number from zero to six, with zero ! being Sunday. The day of week is ignored on input. The year is ! specified with the century, so it should generally be four digits ! except for really long leases. The month is specified as a number ! starting with 1 for January. The day of the month is likewise ! specified starting with 1. The hour is a number between 0 and 23, the ! minute a number between 0 and 59, and the second also a number between ! 0 and 59. ! .PP ! Lease times are specified in Greenwich Mean Time (GMT), not in the ! local time zone. Since Greenwich is actually on Daylight Savings ! Time part of the year, there is probably nowhere in the world where ! the times recorded on a lease are always the same as wall clock times. ! On a unix machine, one can often figure out the current time in GMT by ! typing \fBdate -u\fR. ! .PP ! The MAC address of the network interface that was used to acquire the ! lease is recorded with the \fBhardware\fR statement: ! .PP ! \fBhardware \fIhardware-type mac-address\fB;\fR ! .PP ! The MAC address is specified as a series of hexadecimal octets, ! seperated by colons. ! .PP ! If the client used a client identifier to acquire its address, the ! client identifier is recorded using the \fBuid\fR statement: ! .PP ! \fBuid \fIclient-identifier\fB;\fR ! .PP ! The client identifier is recorded as a series of hexadecimal octets, ! regardless of whether the client specifies an ASCII string or uses the ! newer hardware type/MAC address format. ! .PP ! If the client sends a hostname using the \fIClient Hostname\fR option, ! as specified in some versions of the DHCP-DNS Interaction draft, that ! hostname is recorded using the \fBclient-hostname\fR statement. ! .PP ! \fBclient-hostname "\fIhostname\fB";\fR ! .PP ! If the client sends its hostname using the \fIHostname\fR option, as ! Windows 95 does, it is recorded using the \fBhostname\fR statement. ! .PP ! \fBhostname "\fIhostname\fB";\fR ! .PP ! The DHCP server may determine that a lease has been misused in some ! way, either because a client that has been assigned a lease NAKs it, ! or because the server's own attempt to see if an address is in use ! prior to reusing it reveals that the address is in fact already in ! use. In that case, the \fBabandoned\fR statement will be used to ! indicate that the lease should not be reassigned. ! .PP ! \fBabandoned;\fR ! .PP ! Abandoned leases are reclaimed automatically. When a client asks for ! a new address, and the server finds that there are no new addresses, ! it checks to see if there are any abandoned leases, and allocates the ! least recently abandoned lease. The standard mechanisms for checking ! for lease address conflicts are still followed, so if the abandoned ! lease's IP address is still in use, it will be reabandoned. ! .PP ! If a client \fBrequests\fR an abandoned address, the server assumes ! that the reason the address was abandoned was that the lease file was ! corrupted, and that the client is the machine that responded when the ! lease was probed, causing it to be abandoned. In that case, the ! address is immediately assigned to the client. .SH FILES .B DBDIR/dhcpd.leases diff -rNc2 dhcp-2.0b1pl2/server/dhcpd.leases.cat5 dhcp-2.0b1pl3/server/dhcpd.leases.cat5 *** dhcp-2.0b1pl2/server/dhcpd.leases.cat5 Fri Nov 21 23:05:52 1997 --- dhcp-2.0b1pl3/server/dhcpd.leases.cat5 Thu Jun 25 21:17:25 1998 *************** *** 11,47 **** The Internet Software Consortium DHCP Server keeps a per­ sistent database of leases that it has assigned. This ! database is a free-form ASCII file containing one valid ! declaration per lease. If more than one declaration ! appears for a given lease, the last one in the file is ! used. The file is written as a log, so this is not an ! unusual occurrance. When dhcpd is first installed, there is no lease database. ! However, dhcpd requires that a lease database be present before it will start. To make the initial lease database, just create an empty file called /var/db/dhcpd.leases. ! In order to prevent the lease database from growing with­ ! out bound, the file is rewritten from time to time. First, a temporary lease database is created and all known leases are dumped to it. Then, the old lease database is ! renamed /var/db/dhcpd.leases~. Finally, the newly writ­ ten lease database is moved into place. There is a window of vulnerability where if the dhcpd pro­ ! cess is killed or the system crashes after the old lease ! database has been renamed but before the new one has been ! moved into place, there will be no /var/db/dhcpd.leases. In this case, dhcpd will refuse to start, and will require ! manual intervention. DDOO NNOOTT simply create a new lease file when this happens - if you do, you will lose all your ! old bindings, and chaos will ensue. Instead, rename ! /var/db/dhcpd.leases~ to /var/db/dhcpd.leases, restoring ! the old, valid lease file, and then start dhcpd. This guarantees that a valid lease file will be restored. FFOORRMMAATT ! The format of the lease declarations is not currently doc­ ! umented. FFIILLEESS --- 11,169 ---- The Internet Software Consortium DHCP Server keeps a per­ sistent database of leases that it has assigned. This ! database is a free-form ASCII file containing a series of ! lease declarations. Every time a lease is acquired, ! renewed or released, its new value is recorded at the end ! of the lease file. So if more than one declaration ! appears for a given lease, the last one in the file is the ! current one. When dhcpd is first installed, there is no lease database. ! However, dhcpd requires that a lease database be present before it will start. To make the initial lease database, just create an empty file called /var/db/dhcpd.leases. ! In order to prevent the lease database from growing with­ ! out bound, the file is rewritten from time to time. First, a temporary lease database is created and all known leases are dumped to it. Then, the old lease database is ! renamed /var/db/dhcpd.leases~. Finally, the newly writ­ ten lease database is moved into place. There is a window of vulnerability where if the dhcpd pro­ ! cess is killed or the system crashes after the old lease ! database has been renamed but before the new one has been ! moved into place, there will be no /var/db/dhcpd.leases. In this case, dhcpd will refuse to start, and will require ! manual intervention. DDOO NNOOTT simply create a new lease file when this happens - if you do, you will lose all your ! old bindings, and chaos will ensue. Instead, rename ! /var/db/dhcpd.leases~ to /var/db/dhcpd.leases, restoring ! the old, valid lease file, and then start dhcpd. This guarantees that a valid lease file will be restored. FFOORRMMAATT ! Lease descriptions are stored in a format that is parsed ! by the same recursive descent parser used to read the ! ddhhccppdd..ccoonnff((55)) and ddhhcclliieenntt..ccoonnff((55)) files. Currently, the ! only declaration that is used in the dhcpd.leases file is ! the lleeaassee declaration. ! ! lleeaassee _i_p_-_a_d_d_r_e_s_s {{ _s_t_a_t_e_m_e_n_t_s_._._. }} ! ! Each lease declaration include the single IP address that ! has been leased to the client. The statements within the ! braces define the duration of the lease and to whom it is ! assigned. ! ! The start and end time of a lease are recorded using the ! ``starts'' and ``ends'' statements: ! ! ! ! ! 1 ! ! ! ! ! ! dhcpd.leases(5) dhcpd.leases(5) ! ! ! ssttaarrttss _d_a_t_e;; ! eennddss _d_a_t_e;; ! ! Dates are specified as follows: ! ! _w_e_e_k_d_a_y _y_e_a_r//_m_o_n_t_h//_d_a_y _h_o_u_r::_m_i_n_u_t_e::_s_e_c_o_n_d ! ! The weekday is present to make it easy for a human to tell ! when a lease expires - it's specified as a number from ! zero to six, with zero being Sunday. The day of week is ! ignored on input. The year is specified with the century, ! so it should generally be four digits except for really ! long leases. The month is specified as a number starting ! with 1 for January. The day of the month is likewise ! specified starting with 1. The hour is a number between 0 ! and 23, the minute a number between 0 and 59, and the sec­ ! ond also a number between 0 and 59. ! ! Lease times are specified in Greenwich Mean Time (GMT), ! not in the local time zone. Since Greenwich is actually ! on Daylight Savings Time part of the year, there is proba­ ! bly nowhere in the world where the times recorded on a ! lease are always the same as wall clock times. On a unix ! machine, one can often figure out the current time in GMT ! by typing ddaattee --uu. ! ! The MAC address of the network interface that was used to ! acquire the lease is recorded with the hhaarrddwwaarree statement: ! ! hhaarrddwwaarree _h_a_r_d_w_a_r_e_-_t_y_p_e _m_a_c_-_a_d_d_r_e_s_s;; ! ! The MAC address is specified as a series of hexadecimal ! octets, seperated by colons. ! ! If the client used a client identifier to acquire its ! address, the client identifier is recorded using the uuiidd ! statement: ! ! uuiidd _c_l_i_e_n_t_-_i_d_e_n_t_i_f_i_e_r;; ! ! The client identifier is recorded as a series of hexadeci­ ! mal octets, regardless of whether the client specifies an ! ASCII string or uses the newer hardware type/MAC address ! format. ! ! If the client sends a hostname using the _C_l_i_e_n_t _H_o_s_t_n_a_m_e ! option, as specified in some versions of the DHCP-DNS ! Interaction draft, that hostname is recorded using the ! cclliieenntt--hhoossttnnaammee statement. ! ! cclliieenntt--hhoossttnnaammee ""_h_o_s_t_n_a_m_e"";; ! ! If the client sends its hostname using the _H_o_s_t_n_a_m_e ! option, as Windows 95 does, it is recorded using the ! ! ! ! 2 ! ! ! ! ! ! dhcpd.leases(5) dhcpd.leases(5) ! ! ! hhoossttnnaammee statement. ! ! hhoossttnnaammee ""_h_o_s_t_n_a_m_e"";; ! ! The DHCP server may determine that a lease has been mis­ ! used in some way, either because a client that has been ! assigned a lease NAKs it, or because the server's own ! attempt to see if an address is in use prior to reusing it ! reveals that the address is in fact already in use. In ! that case, the aabbaannddoonneedd statement will be used to indi­ ! cate that the lease should not be reassigned. ! ! aabbaannddoonneedd;; ! ! Abandoned leases are reclaimed automatically. When a ! client asks for a new address, and the server finds that ! there are no new addresses, it checks to see if there are ! any abandoned leases, and allocates the least recently ! abandoned lease. The standard mechanisms for checking ! for lease address conflicts are still followed, so if the ! abandoned lease's IP address is still in use, it will be ! reabandoned. ! ! If a client rreeqquueessttss an abandoned address, the server ! assumes that the reason the address was abandoned was that ! the lease file was corrupted, and that the client is the ! machine that responded when the lease was probed, causing ! it to be abandoned. In that case, the address is immedi­ ! ately assigned to the client. FFIILLEESS *************** *** 62,66 **** ! 1 --- 184,198 ---- ! ! ! ! ! ! ! ! ! ! ! 3