udhcp: abort if we see unknown option, and show valid options if so

function                                             old     new   delta
udhcp_option_idx                                       -      77     +77
udhcp_str2optset                                     366     351     -15
udhcpc_main                                         2845    2801     -44
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 77/-59)             Total: 18 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2010-03-27 23:23:41 +01:00
parent c2fdd41f5f
commit 9107b63a7f
3 changed files with 26 additions and 12 deletions

View File

@ -169,6 +169,8 @@ extern const struct dhcp_option dhcp_options[];
extern const char dhcp_option_strings[];
extern const uint8_t dhcp_option_lengths[];
unsigned FAST_FUNC udhcp_option_idx(const char *name);
uint8_t *udhcp_get_option(struct dhcp_packet *packet, int code) FAST_FUNC;
int udhcp_end_option(uint8_t *optionptr) FAST_FUNC;
void udhcp_add_binary_option(struct dhcp_packet *packet, uint8_t *addopt) FAST_FUNC;