aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-01-08 10:14:17 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-01-08 10:14:17 +0100
commit562f63e9a4583c887012dff782924110b1d1fd6b (patch)
tree96e3eba2b6498c2e39fc559424f8223bf0fc9b73
parentc9807d787d2d9ee5ed9f614c74573e47c8b359ab (diff)
downloadbusybox-562f63e9a4583c887012dff782924110b1d1fd6b.tar.gz
dhcprelay: code shrink
function old new delta dhcprelay_main 961 958 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/udhcp/dhcprelay.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/networking/udhcp/dhcprelay.c b/networking/udhcp/dhcprelay.c
index 4d5644093..86dcb1af0 100644
--- a/networking/udhcp/dhcprelay.c
+++ b/networking/udhcp/dhcprelay.c
@@ -254,7 +254,7 @@ static void pass_to_client(struct dhcp_packet *p, int packet_len, int *fds)
}
int dhcprelay_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int dhcprelay_main(int argc, char **argv)
+int dhcprelay_main(int argc UNUSED_PARAM, char **argv)
{
struct sockaddr_in server_addr;
char **iface_list;
@@ -269,11 +269,11 @@ int dhcprelay_main(int argc, char **argv)
server_addr.sin_port = htons(SERVER_PORT);
/* dhcprelay CLIENT_IFACE1[,CLIENT_IFACE2...] SERVER_IFACE [SERVER_IP] */
- if (argc == 4) {
+ if (!argv[1] || !argv[2])
+ bb_show_usage();
+ if (argv[3]) {
if (!inet_aton(argv[3], &server_addr.sin_addr))
bb_perror_msg_and_die("bad server IP");
- } else if (argc != 3) {
- bb_show_usage();
}
iface_list = make_iface_list(argv + 1, &num_sockets);