Rewrite get_option(): new version fixes at least one bug, and is much easier
to understand and verify as correct. It also returns the length of the extracted option.
This commit is contained in:
@ -79,7 +79,7 @@ unsigned char *alloc_option(unsigned char code, unsigned char *optdata,
|
||||
unsigned char *alloc_dhcp_client_id_option(unsigned char type,
|
||||
unsigned char *idstr, size_t idstrlen);
|
||||
|
||||
uint8_t *get_option(struct dhcpMessage *packet, int code);
|
||||
uint8_t *get_option(struct dhcpMessage *packet, int code, ssize_t *optlen);
|
||||
int end_option(uint8_t *optionptr);
|
||||
int add_option_string(unsigned char *optionptr, unsigned char *string);
|
||||
int add_simple_option(unsigned char *optionptr, unsigned char code, uint32_t data);
|
||||
|
Reference in New Issue
Block a user