aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/options.c')
-rw-r--r--networking/udhcp/options.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/networking/udhcp/options.c b/networking/udhcp/options.c
index 8dba2ef69..5cc08cca0 100644
--- a/networking/udhcp/options.c
+++ b/networking/udhcp/options.c
@@ -76,12 +76,12 @@ uint8_t *get_option(struct dhcpMessage *packet, int code)
76 length = 308; 76 length = 308;
77 while (!done) { 77 while (!done) {
78 if (i >= length) { 78 if (i >= length) {
79 bb_error_msg("Bogus packet, option fields too long"); 79 bb_error_msg("bogus packet, option fields too long");
80 return NULL; 80 return NULL;
81 } 81 }
82 if (optionptr[i + OPT_CODE] == code) { 82 if (optionptr[i + OPT_CODE] == code) {
83 if (i + 1 + optionptr[i + OPT_LEN] >= length) { 83 if (i + 1 + optionptr[i + OPT_LEN] >= length) {
84 bb_error_msg("Bogus packet, option fields too long"); 84 bb_error_msg("bogus packet, option fields too long");
85 return NULL; 85 return NULL;
86 } 86 }
87 return optionptr + i + 2; 87 return optionptr + i + 2;
@@ -92,7 +92,7 @@ uint8_t *get_option(struct dhcpMessage *packet, int code)
92 break; 92 break;
93 case DHCP_OPTION_OVER: 93 case DHCP_OPTION_OVER:
94 if (i + 1 + optionptr[i + OPT_LEN] >= length) { 94 if (i + 1 + optionptr[i + OPT_LEN] >= length) {
95 bb_error_msg("Bogus packet, option fields too long"); 95 bb_error_msg("bogus packet, option fields too long");
96 return NULL; 96 return NULL;
97 } 97 }
98 over = optionptr[i + 3]; 98 over = optionptr[i + 3];
@@ -140,7 +140,7 @@ int add_option_string(uint8_t *optionptr, uint8_t *string)
140 140
141 /* end position + string length + option code/length + end option */ 141 /* end position + string length + option code/length + end option */
142 if (end + string[OPT_LEN] + 2 + 1 >= 308) { 142 if (end + string[OPT_LEN] + 2 + 1 >= 308) {
143 bb_error_msg("Option 0x%02x did not fit into the packet", 143 bb_error_msg("option 0x%02x did not fit into the packet",
144 string[OPT_CODE]); 144 string[OPT_CODE]);
145 return 0; 145 return 0;
146 } 146 }