Don't use malloc in ndhc. The only place it was used is in the options code.

Allow the user to specify the vendor identification option value using the
-V switch.  The default value is still "ndhc".
This commit is contained in:
Nicholas J. Kain
2011-07-02 03:48:08 -04:00
parent 7104b56ab9
commit d9571c62cf
5 changed files with 96 additions and 120 deletions

View File

@@ -82,16 +82,12 @@ const char *option_name(uint8_t code);
enum option_type option_type(uint8_t code);
uint8_t option_length(uint8_t code);
int option_valid_list(uint8_t code);
uint8_t *alloc_option(uint8_t code, uint8_t *optdata, size_t datalen);
uint8_t *alloc_dhcp_client_id_option(uint8_t type, uint8_t *idstr,
size_t idstrlen);
uint8_t *get_option_data(struct dhcpmsg *packet, int code, ssize_t *optlen);
ssize_t get_end_option_idx(struct dhcpmsg *packet);
size_t add_option_string(struct dhcpmsg *packet, uint8_t *optstr);
size_t add_option_string(struct dhcpmsg *packet, uint8_t code, char *str,
size_t slen);
size_t add_u32_option(struct dhcpmsg *packet, uint8_t code, uint32_t data);
void add_option_request_list(struct dhcpmsg *packet);
void add_option_vendor_string(struct dhcpmsg *packet);
size_t add_option_request_list(struct dhcpmsg *packet);
#endif