search for: options_pad

Displaying 1 result from an estimated 1 matches for "options_pad".

2011 Jul 18
2
ipconfig:About the length of 'options' field of DHCP packet
...[4] = optional vendor class */ /* [5] = optional hostname */ /* [6] = {dhcp_end, sizeof(dhcp_end)} */ + /* [7] = optional padding */ }; /* @@ -167,6 +169,7 @@ static int dhcp_send(struct netdev *dev, struct iovec *vec) { struct bootp_hdr bootp; char dhcp_hostname[SYS_NMLN+2]; + uint8_t options_padding[64]; int i = 4; memset(&bootp, 0, sizeof(struct bootp_hdr)); @@ -212,6 +215,25 @@ static int dhcp_send(struct netdev *dev, struct iovec *vec) vec[i].iov_base = dhcp_end; vec[i].iov_len = sizeof(dhcp_end); + + if(dev->bootp.fail_count & 1){ + /* + * Append padding if...