diff options
author | Denys Vlasenko | 2021-09-02 13:59:39 +0200 |
---|---|---|
committer | Denys Vlasenko | 2021-09-02 14:02:23 +0200 |
commit | d99dee944eabab5184c356027b0a7a9dd9e2541a (patch) | |
tree | ee9b1cb2aa904668f9f93b155bc7cea7349c2749 /networking/udhcp/dhcpd.c | |
parent | a51d953b95a7cc6b40a6b3a5bfd95f3154acf5e2 (diff) | |
download | busybox-d99dee944eabab5184c356027b0a7a9dd9e2541a.zip busybox-d99dee944eabab5184c356027b0a7a9dd9e2541a.tar.gz |
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>
Diffstat (limited to 'networking/udhcp/dhcpd.c')
-rw-r--r-- | networking/udhcp/dhcpd.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c index 91f7097..eef8a3b 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c @@ -27,7 +27,7 @@ //kbuild:lib-$(CONFIG_FEATURE_UDHCP_RFC3397) += domain_codec.o //usage:#define udhcpd_trivial_usage -//usage: "[-fS] [-I ADDR]" IF_FEATURE_UDHCP_PORT(" [-P PORT]") " [CONFFILE]" +//usage: "[-fS] [-I ADDR] [-a MSEC]" IF_FEATURE_UDHCP_PORT(" [-P PORT]") " [CONFFILE]" //usage:#define udhcpd_full_usage "\n\n" //usage: "DHCP server\n" //usage: "\n -f Run in foreground" @@ -877,6 +877,12 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv) /* Setup the signal pipe on fds 3,4 - must be before openlog() */ udhcp_sp_setup(); +#define OPT_f (1 << 0) +#define OPT_S (1 << 1) +#define OPT_I (1 << 2) +#define OPT_v (1 << 3) +#define OPT_a (1 << 4) +#define OPT_P (1 << 5) opt = getopt32(argv, "^" "fSI:va:"IF_FEATURE_UDHCP_PORT("P:") "\0" @@ -887,24 +893,24 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv) , &str_a IF_FEATURE_UDHCP_PORT(, &str_P) IF_UDHCP_VERBOSE(, &dhcp_verbose) - ); - if (!(opt & 1)) { /* no -f */ + ); + if (!(opt & OPT_f)) { /* no -f */ bb_daemonize_or_rexec(0, argv); logmode = LOGMODE_NONE; } /* update argv after the possible vfork+exec in daemonize */ argv += optind; - if (opt & 2) { /* -S */ + if (opt & OPT_S) { openlog(applet_name, LOG_PID, LOG_DAEMON); logmode |= LOGMODE_SYSLOG; } - if (opt & 4) { /* -I */ + if (opt & OPT_I) { len_and_sockaddr *lsa = xhost_and_af2sockaddr(str_I, 0, AF_INET); server_data.server_nip = lsa->u.sin.sin_addr.s_addr; free(lsa); } #if ENABLE_FEATURE_UDHCP_PORT - if (opt & 32) { /* -P */ + if (opt & OPT_P) { SERVER_PORT = xatou16(str_P); CLIENT_PORT = SERVER_PORT + 1; } |