NetBSD Problem Report #38830

From martin@duskware.de  Mon Jun  2 09:22:25 2008
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 4F08163BA89
	for <gnats-bugs@gnats.netbsd.org>; Mon,  2 Jun 2008 09:22:25 +0000 (UTC)
Message-Id: <20080602000448.5B73963BA89@narn.NetBSD.org>
Date: Mon,  2 Jun 2008 00:04:48 +0000 (UTC)
From: tmcintos@avalon.net
Reply-To: tmcintos@avalon.net
To: netbsd-bugs-owner@NetBSD.org
Subject: NFS_BOOT_DHCP code should include Parameter Request List option (55) in DHCP request
X-Send-Pr-Version: www-1.0

>Number:         38830
>Category:       kern
>Synopsis:       NFS_BOOT_DHCP code should include Parameter Request List option (55) in DHCP request
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 02 09:25:00 +0000 2008
>Closed-Date:    Fri Jul 10 01:39:50 +0000 2009
>Last-Modified:  Fri Jul 10 01:39:50 +0000 2009
>Originator:     Tim McIntosh
>Release:        3.0.1
>Organization:
>Environment:
>Description:
When booting a kernel configured with theNFS_BOOT_DHCP option, the kernel does not include the Parameter Request List DHCP option (55) in its DHCP request.  The Mac OS X DHCP server (bootpd) only sends DHCP options that are explicitly requested by the client.  Thus, diskless booting fails when using the Mac OS X DHCP server.
>How-To-Repeat:
Attempt diskless boot using Mac OS X DHCP server.
>Fix:
The following patch adds the Parameter Request List option, allowing diskless booting to work with the Mac OS X DHCP server.

Index: nfs_bootdhcp.c
===================================================================
RCS file: /cvsroot/src/sys/nfs/nfs_bootdhcp.c,v
retrieving revision 1.28
diff -r1.28 nfs_bootdhcp.c
617,625c617,632
< 		bootp->bp_vend[6] = DHCPREQUEST;
< 		bootp->bp_vend[7] = TAG_REQ_ADDR;
< 		bootp->bp_vend[8] = 4;
< 		memcpy(&bootp->bp_vend[9], &bpc.replybuf->bp_yiaddr, 4);
< 		bootp->bp_vend[13] = TAG_SERVERID;
< 		bootp->bp_vend[14] = 4;
< 		memcpy(&bootp->bp_vend[15], &bpc.dhcp_serverip.s_addr, 4);
< 		bootp->bp_vend[19] = TAG_LEASETIME;
< 		bootp->bp_vend[20] = 4;
---
> 		unsigned int index = 6;
> 
> 		bootp->bp_vend[index++] = DHCPREQUEST;
> 
> 		bootp->bp_vend[index++] = TAG_REQ_ADDR;
> 		bootp->bp_vend[index++] = 4;
> 		memcpy(&bootp->bp_vend[index], &bpc.replybuf->bp_yiaddr, 4);
> 		index += 4;
> 
> 		bootp->bp_vend[index++] = TAG_SERVERID;
> 		bootp->bp_vend[index++] = 4;
> 		memcpy(&bootp->bp_vend[index], &bpc.dhcp_serverip.s_addr, 4);
> 		index += 4;
> 
> 		bootp->bp_vend[index++] = TAG_LEASETIME;
> 		bootp->bp_vend[index++] = 4;
627,631c634,651
< 		memcpy(&bootp->bp_vend[21], &leasetime, 4);
< 		bootp->bp_vend[25] = TAG_CLASSID;
< 		bootp->bp_vend[26] = vcilen;
< 		memcpy(&bootp->bp_vend[27], vci, vcilen);
< 		bootp->bp_vend[27 + vcilen] = TAG_END;
---
> 		memcpy(&bootp->bp_vend[index], &leasetime, 4);
> 		index += 4;
> 
> 		bootp->bp_vend[index++] = TAG_PARAM_REQ;
> 		bootp->bp_vend[index++] = 6;
> 		bootp->bp_vend[index++] = TAG_SUBNET_MASK;
> 		bootp->bp_vend[index++] = TAG_GATEWAY;
> 		bootp->bp_vend[index++] = TAG_HOST_NAME;
> 		bootp->bp_vend[index++] = TAG_DOMAIN_NAME;
> 		bootp->bp_vend[index++] = TAG_ROOT_PATH;
> 		bootp->bp_vend[index++] = TAG_SWAP_SERVER;
> 
> 		bootp->bp_vend[index++] = TAG_CLASSID;
> 		bootp->bp_vend[index++] = vcilen;
> 		memcpy(&bootp->bp_vend[index], vci, vcilen);
> 		index += vcilen;
> 
> 		bootp->bp_vend[index] = TAG_END;


>Release-Note:

>Audit-Trail:
From: Roy Marples <roy@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/38830 CVS commit: src/sys/nfs
Date: Fri, 10 Jul 2009 01:29:55 +0000

 Module Name:	src
 Committed By:	roy
 Date:		Fri Jul 10 01:29:55 UTC 2009

 Modified Files:
 	src/sys/nfs: nfs_bootdhcp.c

 Log Message:
 When using DHCP, request the parameters that we need. Fixes PR kern/38830.
 Thanks to Tim McIntosh.


 To generate a diff of this commit:
 cvs rdiff -u -r1.48 -r1.49 src/sys/nfs/nfs_bootdhcp.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: roy@NetBSD.org
State-Changed-When: Fri, 10 Jul 2009 01:39:50 +0000
State-Changed-Why:
Confirmed submitter patch works


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.