aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-09-02 13:59:39 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-09-02 14:02:23 +0200
commitd99dee944eabab5184c356027b0a7a9dd9e2541a (patch)
treeee9b1cb2aa904668f9f93b155bc7cea7349c2749
parenta51d953b95a7cc6b40a6b3a5bfd95f3154acf5e2 (diff)
downloadbusybox-w32-d99dee944eabab5184c356027b0a7a9dd9e2541a.tar.gz
busybox-w32-d99dee944eabab5184c356027b0a7a9dd9e2541a.tar.bz2
busybox-w32-d99dee944eabab5184c356027b0a7a9dd9e2541a.zip
udhcpd: update --help to include -a MSEC
function old new delta packed_usage 33886 33891 +5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/udhcp/dhcpd.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index 91f70970a..eef8a3b59 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -27,7 +27,7 @@
27//kbuild:lib-$(CONFIG_FEATURE_UDHCP_RFC3397) += domain_codec.o 27//kbuild:lib-$(CONFIG_FEATURE_UDHCP_RFC3397) += domain_codec.o
28 28
29//usage:#define udhcpd_trivial_usage 29//usage:#define udhcpd_trivial_usage
30//usage: "[-fS] [-I ADDR]" IF_FEATURE_UDHCP_PORT(" [-P PORT]") " [CONFFILE]" 30//usage: "[-fS] [-I ADDR] [-a MSEC]" IF_FEATURE_UDHCP_PORT(" [-P PORT]") " [CONFFILE]"
31//usage:#define udhcpd_full_usage "\n\n" 31//usage:#define udhcpd_full_usage "\n\n"
32//usage: "DHCP server\n" 32//usage: "DHCP server\n"
33//usage: "\n -f Run in foreground" 33//usage: "\n -f Run in foreground"
@@ -877,6 +877,12 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
877 /* Setup the signal pipe on fds 3,4 - must be before openlog() */ 877 /* Setup the signal pipe on fds 3,4 - must be before openlog() */
878 udhcp_sp_setup(); 878 udhcp_sp_setup();
879 879
880#define OPT_f (1 << 0)
881#define OPT_S (1 << 1)
882#define OPT_I (1 << 2)
883#define OPT_v (1 << 3)
884#define OPT_a (1 << 4)
885#define OPT_P (1 << 5)
880 opt = getopt32(argv, "^" 886 opt = getopt32(argv, "^"
881 "fSI:va:"IF_FEATURE_UDHCP_PORT("P:") 887 "fSI:va:"IF_FEATURE_UDHCP_PORT("P:")
882 "\0" 888 "\0"
@@ -887,24 +893,24 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
887 , &str_a 893 , &str_a
888 IF_FEATURE_UDHCP_PORT(, &str_P) 894 IF_FEATURE_UDHCP_PORT(, &str_P)
889 IF_UDHCP_VERBOSE(, &dhcp_verbose) 895 IF_UDHCP_VERBOSE(, &dhcp_verbose)
890 ); 896 );
891 if (!(opt & 1)) { /* no -f */ 897 if (!(opt & OPT_f)) { /* no -f */
892 bb_daemonize_or_rexec(0, argv); 898 bb_daemonize_or_rexec(0, argv);
893 logmode = LOGMODE_NONE; 899 logmode = LOGMODE_NONE;
894 } 900 }
895 /* update argv after the possible vfork+exec in daemonize */ 901 /* update argv after the possible vfork+exec in daemonize */
896 argv += optind; 902 argv += optind;
897 if (opt & 2) { /* -S */ 903 if (opt & OPT_S) {
898 openlog(applet_name, LOG_PID, LOG_DAEMON); 904 openlog(applet_name, LOG_PID, LOG_DAEMON);
899 logmode |= LOGMODE_SYSLOG; 905 logmode |= LOGMODE_SYSLOG;
900 } 906 }
901 if (opt & 4) { /* -I */ 907 if (opt & OPT_I) {
902 len_and_sockaddr *lsa = xhost_and_af2sockaddr(str_I, 0, AF_INET); 908 len_and_sockaddr *lsa = xhost_and_af2sockaddr(str_I, 0, AF_INET);
903 server_data.server_nip = lsa->u.sin.sin_addr.s_addr; 909 server_data.server_nip = lsa->u.sin.sin_addr.s_addr;
904 free(lsa); 910 free(lsa);
905 } 911 }
906#if ENABLE_FEATURE_UDHCP_PORT 912#if ENABLE_FEATURE_UDHCP_PORT
907 if (opt & 32) { /* -P */ 913 if (opt & OPT_P) {
908 SERVER_PORT = xatou16(str_P); 914 SERVER_PORT = xatou16(str_P);
909 CLIENT_PORT = SERVER_PORT + 1; 915 CLIENT_PORT = SERVER_PORT + 1;
910 } 916 }