mirror of https://github.com/ipxe/ipxe.git
Fix endianness of dhcp device id structure.
parent
5abc43a320
commit
e02c699a05
|
@ -916,11 +916,14 @@ static int bootp(void)
|
||||||
unsigned char *bp_vend;
|
unsigned char *bp_vend;
|
||||||
|
|
||||||
#ifndef NO_DHCP_SUPPORT
|
#ifndef NO_DHCP_SUPPORT
|
||||||
dhcp_machine_info[4] = dev.devid.bus_type;
|
struct {
|
||||||
dhcp_machine_info[5] = dev.devid.vendor_id & 0xff;
|
uint8_t bus_type;
|
||||||
dhcp_machine_info[6] = ((dev.devid.vendor_id) >> 8) & 0xff;
|
uint16_t vendor_id;
|
||||||
dhcp_machine_info[7] = dev.devid.device_id & 0xff;
|
uint16_t device_id;
|
||||||
dhcp_machine_info[8] = ((dev.devid.device_id) >> 8) & 0xff;
|
} __attribute__((packed)) *dhcp_dev_id = (void*)&dhcp_machine_info[4];
|
||||||
|
dhcp_dev_id->bus_type = dev.devid.bus_type;
|
||||||
|
dhcp_dev_id->vendor_id = htons ( dev.devid.vendor_id );
|
||||||
|
dhcp_dev_id->device_id = htons ( dev.devid.device_id );
|
||||||
#endif /* NO_DHCP_SUPPORT */
|
#endif /* NO_DHCP_SUPPORT */
|
||||||
memset(&ip, 0, sizeof(struct bootpip_t));
|
memset(&ip, 0, sizeof(struct bootpip_t));
|
||||||
ip.bp.bp_op = BOOTP_REQUEST;
|
ip.bp.bp_op = BOOTP_REQUEST;
|
||||||
|
|
Loading…
Reference in New Issue