summaryrefslogtreecommitdiff
path: root/networking/udhcp
diff options
context:
space:
mode:
authorDenys Vlasenko2021-03-16 11:42:56 +0100
committerDenys Vlasenko2021-03-16 11:42:56 +0100
commitfe78d70ec6c48f88126f6deffe04d4707a65c9ac (patch)
treec19b4ea47dad8bb445b25334d9b9b3e6adeffeb4 /networking/udhcp
parent1c461df70ab357dc9e1e064540731c58e7859a45 (diff)
downloadbusybox-fe78d70ec6c48f88126f6deffe04d4707a65c9ac.zip
busybox-fe78d70ec6c48f88126f6deffe04d4707a65c9ac.tar.gz
udhcpc: ignore zero-length DHCP options, take 2
advance the optionptr by two bytes, not one Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp')
-rw-r--r--networking/udhcp/common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
index 99ecb7a..f2d6907 100644
--- a/networking/udhcp/common.c
+++ b/networking/udhcp/common.c
@@ -282,11 +282,11 @@ uint8_t* FAST_FUNC udhcp_scan_options(struct dhcp_packet *packet, struct dhcp_sc
* (this violates RFC 2132 section 3.14).
*/
if (len == 0) {
- scan_state->rem -= OPT_LEN;
- scan_state->optionptr += OPT_LEN;
+ scan_state->rem -= 2;
+ scan_state->optionptr += 2;
continue;
}
- len += OPT_LEN;
+ len += 2;
scan_state->rem -= len;
if (scan_state->rem < 0) /* option is longer than options field? */
goto complain; /* yes, complain and return NULL */