dhcpc: cope with buggy DHCP servers which send oversized packets

(Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>)
This commit is contained in:
Denis Vlasenko
2007-11-25 03:15:24 +00:00
parent a8875efa85
commit 72e76044cf
3 changed files with 27 additions and 3 deletions

View File

@@ -145,7 +145,7 @@ int add_option_string(uint8_t *optionptr, uint8_t *string)
int end = end_option(optionptr);
/* end position + string length + option code/length + end option */
if (end + string[OPT_LEN] + 2 + 1 >= 308) {
if (end + string[OPT_LEN] + 2 + 1 >= DHCP_OPTIONS_BUFSIZE) {
bb_error_msg("option 0x%02x did not fit into the packet",
string[OPT_CODE]);
return 0;