diff options
author | Denys Vlasenko | 2018-12-17 18:07:18 +0100 |
---|---|---|
committer | Denys Vlasenko | 2018-12-17 18:07:18 +0100 |
commit | 6d3b4bb24da9a07c263f3c1acf8df85382ff562c (patch) | |
tree | 62b1094f93c955774e8b2d4aee798029a5a71b7d /networking/udhcp/dhcpc.c | |
parent | 4b72aebe80aaa50a765d5ff61d7d67ed731502d9 (diff) | |
download | busybox-6d3b4bb24da9a07c263f3c1acf8df85382ff562c.zip busybox-6d3b4bb24da9a07c263f3c1acf8df85382ff562c.tar.gz |
udhcpc: check that 4-byte options are indeed 4-byte, closes 11506
function old new delta
udhcp_get_option32 - 27 +27
udhcp_get_option 231 248 +17
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/0 up/down: 44/0) Total: 44 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r-- | networking/udhcp/dhcpc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 4b23e4d..5b3fd53 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c @@ -1691,7 +1691,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) * They say ISC DHCP client supports this case. */ server_addr = 0; - temp = udhcp_get_option(&packet, DHCP_SERVER_ID); + temp = udhcp_get_option32(&packet, DHCP_SERVER_ID); if (!temp) { bb_error_msg("no server ID, using 0.0.0.0"); } else { @@ -1718,7 +1718,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) struct in_addr temp_addr; uint8_t *temp; - temp = udhcp_get_option(&packet, DHCP_LEASE_TIME); + temp = udhcp_get_option32(&packet, DHCP_LEASE_TIME); if (!temp) { bb_error_msg("no lease time with ACK, using 1 hour lease"); lease_seconds = 60 * 60; @@ -1813,7 +1813,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) uint32_t svid; uint8_t *temp; - temp = udhcp_get_option(&packet, DHCP_SERVER_ID); + temp = udhcp_get_option32(&packet, DHCP_SERVER_ID); if (!temp) { non_matching_svid: log1("received DHCP NAK with wrong" |