Subject: bin/6874: dhcpd filename
To: None <gnats-bugs@gnats.netbsd.org>
From: None <sborrill@xemplar.co.uk>
List: netbsd-bugs
Date: 01/25/1999 17:05:42
>Number:         6874
>Category:       bin
>Synopsis:       dhcpd can't provide a default filename to bootp clients
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 25 09:35:01 1999
>Last-Modified:
>Originator:     Stephen Borrill
>Organization:
	Xemplar Education Ltd
>Release:        1998/05/18
>Environment:
	
System: NetBSD black 1.3F NetBSD 1.3F (XEMPLAR_CATS) #4: Mon Jun 15 17:57:31 BST 1998 root@fan82:/usr/tmp/netbsd-13f/src/sys/arch/arm32/compile/XEMPLAR_CATS arm32


>Description:
If dhcpd is set up to use dynamic-bootp, you can't specify a
filename for the bootp clients to use as you can't use dynamic-bootp in
a group section. Therefore, the only play to specify a filename is as
a global parameter, however this is ignored. The patch allows a global
filename to be specified which is only used as a last resort.
>How-To-Repeat:
The following /etc/dhcpd.conf will fail to boot a bootp client requiring
a valid filename:

option domain-name-servers 194.205.192.15;
max-lease-time 172800;
filename "/usr/export/home/ncd/boot";
get-lease-hostnames on;

shared-network XEMPLARNC {
  subnet 194.205.192.0 netmask 255.255.255.0 {
    option routers 194.205.192.15;
    range dynamic-bootp 194.205.192.46 194.205.192.46;
  }
}
 
>Fix:
*** dhcp.c	Mon May 18 12:14:04 1998
--- dhcp.c.new	Fri Jan  8 17:56:09 1999
***************
*** 616,621 ****
--- 616,623 ----
  		state -> filename = user_class -> group -> filename;
  	else if (vendor_class  && vendor_class -> group -> filename)
  		state -> filename = vendor_class -> group -> filename;
+ 	else if (root_group.filename)
+ 	        state -> filename = root_group.filename;
  	else state -> filename = (char *)0;
  
  	/* Choose a server name as above. */

>Audit-Trail:
>Unformatted: