aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-06-15 01:42:21 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-06-15 01:42:21 +0200
commitebe8c14d34d3f6957b4e44967c9089b84e144ddf (patch)
tree519d8b4fc2a7214af62af0098a1ec362b1dccb77
parent9e27fed6b9a21454149873cfc4e034c8226f8ffb (diff)
downloadbusybox-w32-ebe8c14d34d3f6957b4e44967c9089b84e144ddf.tar.gz
busybox-w32-ebe8c14d34d3f6957b4e44967c9089b84e144ddf.tar.bz2
busybox-w32-ebe8c14d34d3f6957b4e44967c9089b84e144ddf.zip
udhcpc: do not use inet_addr() to parse -r REQ_IP, it's deprecated
...and we did not error-check it, and this is the only use of it: function old new delta inet_addr 37 - -37 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/udhcp/dhcpc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index d67f60c00..ab9edd264 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -1284,7 +1284,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
1284 memcpy(p + OPT_DATA + 3, str_F, len); /* do not store NUL byte */ 1284 memcpy(p + OPT_DATA + 3, str_F, len); /* do not store NUL byte */
1285 } 1285 }
1286 if (opt & OPT_r) 1286 if (opt & OPT_r)
1287 requested_ip = inet_addr(str_r); 1287 if (!inet_aton(str_r, (void*)&requested_ip))
1288 bb_show_usage();
1288#if ENABLE_FEATURE_UDHCP_PORT 1289#if ENABLE_FEATURE_UDHCP_PORT
1289 if (opt & OPT_P) { 1290 if (opt & OPT_P) {
1290 CLIENT_PORT = xatou16(str_P); 1291 CLIENT_PORT = xatou16(str_P);