Browse Source

Request Etherboot encapsulated options.

Parameter request list is yet another option that ISC dhcpd ignores
unless it's in the main options block.

Fix logic error in parsing file and sname fields.
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
3085f03ad4
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      src/net/udp/dhcp.c

+ 5
- 3
src/net/udp/dhcp.c View File

54
 	DHCP_VENDOR_CLASS_ID,
54
 	DHCP_VENDOR_CLASS_ID,
55
 	DHCP_STRING (  'E', 't', 'h', 'e', 'r', 'b', 'o', 'o', 't' ),
55
 	DHCP_STRING (  'E', 't', 'h', 'e', 'r', 'b', 'o', 'o', 't' ),
56
 	DHCP_PARAMETER_REQUEST_LIST,
56
 	DHCP_PARAMETER_REQUEST_LIST,
57
-	DHCP_OPTION ( DHCP_SUBNET_MASK, DHCP_ROUTERS, DHCP_HOST_NAME ),
57
+	DHCP_OPTION ( DHCP_SUBNET_MASK, DHCP_ROUTERS, DHCP_HOST_NAME,
58
+		      DHCP_EB_ENCAP ),
58
 	DHCP_END
59
 	DHCP_END
59
 };
60
 };
60
 
61
 
125
 		return 0;
126
 		return 0;
126
 	case DHCP_MESSAGE_TYPE:
127
 	case DHCP_MESSAGE_TYPE:
127
 	case DHCP_REQUESTED_ADDRESS:
128
 	case DHCP_REQUESTED_ADDRESS:
129
+	case DHCP_PARAMETER_REQUEST_LIST:
128
 		/* These options have to be within the main options
130
 		/* These options have to be within the main options
129
 		 * block.  This doesn't seem to be required by the
131
 		 * block.  This doesn't seem to be required by the
130
 		 * RFCs, but at least ISC dhcpd refuses to recognise
132
 		 * RFCs, but at least ISC dhcpd refuses to recognise
438
 	/* Merge in "file" and "sname" fields */
440
 	/* Merge in "file" and "sname" fields */
439
 	merge_dhcp_field ( options, dhcphdr->file, sizeof ( dhcphdr->file ),
441
 	merge_dhcp_field ( options, dhcphdr->file, sizeof ( dhcphdr->file ),
440
 			   ( ( overloading & DHCP_OPTION_OVERLOAD_FILE ) ?
442
 			   ( ( overloading & DHCP_OPTION_OVERLOAD_FILE ) ?
441
-			     DHCP_BOOTFILE_NAME : 0 ) );
443
+			     0 : DHCP_BOOTFILE_NAME ) );
442
 	merge_dhcp_field ( options, dhcphdr->sname, sizeof ( dhcphdr->sname ),
444
 	merge_dhcp_field ( options, dhcphdr->sname, sizeof ( dhcphdr->sname ),
443
 			   ( ( overloading & DHCP_OPTION_OVERLOAD_SNAME ) ?
445
 			   ( ( overloading & DHCP_OPTION_OVERLOAD_SNAME ) ?
444
-			     DHCP_TFTP_SERVER_NAME : 0 ) );
446
+			     0 : DHCP_TFTP_SERVER_NAME ) );
445
 
447
 
446
 	/* Set magic options for "yiaddr" and "siaddr", if present */
448
 	/* Set magic options for "yiaddr" and "siaddr", if present */
447
 	if ( dhcphdr->yiaddr.s_addr ) {
449
 	if ( dhcphdr->yiaddr.s_addr ) {

Loading…
Cancel
Save