NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
kern/38830: NFS_BOOT_DHCP code should include Parameter Request List option (55) in DHCP request
>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: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Jun 02 09:25:00 +0000 2008
>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;
Home |
Main Index |
Thread Index |
Old Index