Kaynağa Gözat

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 yıl önce
ebeveyn
işleme
3085f03ad4
1 değiştirilmiş dosya ile 5 ekleme ve 3 silme
  1. 5
    3
      src/net/udp/dhcp.c

+ 5
- 3
src/net/udp/dhcp.c Dosyayı Görüntüle

@@ -54,7 +54,8 @@ static uint8_t dhcp_request_options_data[] = {
54 54
 	DHCP_VENDOR_CLASS_ID,
55 55
 	DHCP_STRING (  'E', 't', 'h', 'e', 'r', 'b', 'o', 'o', 't' ),
56 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 59
 	DHCP_END
59 60
 };
60 61
 
@@ -125,6 +126,7 @@ static int set_dhcp_packet_option ( struct dhcp_packet *dhcppkt,
125 126
 		return 0;
126 127
 	case DHCP_MESSAGE_TYPE:
127 128
 	case DHCP_REQUESTED_ADDRESS:
129
+	case DHCP_PARAMETER_REQUEST_LIST:
128 130
 		/* These options have to be within the main options
129 131
 		 * block.  This doesn't seem to be required by the
130 132
 		 * RFCs, but at least ISC dhcpd refuses to recognise
@@ -438,10 +440,10 @@ static struct dhcp_option_block * dhcp_parse ( struct dhcphdr *dhcphdr,
438 440
 	/* Merge in "file" and "sname" fields */
439 441
 	merge_dhcp_field ( options, dhcphdr->file, sizeof ( dhcphdr->file ),
440 442
 			   ( ( overloading & DHCP_OPTION_OVERLOAD_FILE ) ?
441
-			     DHCP_BOOTFILE_NAME : 0 ) );
443
+			     0 : DHCP_BOOTFILE_NAME ) );
442 444
 	merge_dhcp_field ( options, dhcphdr->sname, sizeof ( dhcphdr->sname ),
443 445
 			   ( ( overloading & DHCP_OPTION_OVERLOAD_SNAME ) ?
444
-			     DHCP_TFTP_SERVER_NAME : 0 ) );
446
+			     0 : DHCP_TFTP_SERVER_NAME ) );
445 447
 
446 448
 	/* Set magic options for "yiaddr" and "siaddr", if present */
447 449
 	if ( dhcphdr->yiaddr.s_addr ) {

Loading…
İptal
Kaydet