diff options
author | Denis Vlasenko | 2008-02-04 13:12:16 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-02-04 13:12:16 +0000 |
commit | d55fe3e595eb0aad60484d273e251cfee4ef8aa5 (patch) | |
tree | 1b9ff57d70411902db36582da8dbaded99485eeb /networking/udhcp/dhcpd.c | |
parent | e8ef7ec7de0cd9906b42a94eddb800ed1229a614 (diff) | |
download | busybox-d55fe3e595eb0aad60484d273e251cfee4ef8aa5.zip busybox-d55fe3e595eb0aad60484d273e251cfee4ef8aa5.tar.gz |
udhcp: optional support for non-standard DHCP ports (+300 bytes when selected)
Diffstat (limited to 'networking/udhcp/dhcpd.c')
-rw-r--r-- | networking/udhcp/dhcpd.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c index 45f445b..eb7323d 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c @@ -12,6 +12,7 @@ #include <syslog.h> #include "common.h" +#include "dhcpc.h" #include "dhcpd.h" #include "options.h" @@ -35,8 +36,14 @@ int udhcpd_main(int argc, char **argv) unsigned opt; struct option_set *option; struct dhcpOfferedAddr *lease, static_lease; + USE_FEATURE_UDHCP_PORT(char *str_P;) - opt = getopt32(argv, "fS"); +#if ENABLE_FEATURE_UDHCP_PORT + SERVER_PORT = 67; + CLIENT_PORT = 68; +#endif + + opt = getopt32(argv, "fS" USE_FEATURE_UDHCP_PORT("P:", &str_P)); argv += optind; if (!(opt & 1)) { /* no -f */ @@ -48,7 +55,12 @@ int udhcpd_main(int argc, char **argv) openlog(applet_name, LOG_PID, LOG_LOCAL0); logmode |= LOGMODE_SYSLOG; } - +#if ENABLE_FEATURE_UDHCP_PORT + if (opt & 4) { /* -P */ + SERVER_PORT = xatou16(str_P); + CLIENT_PORT = SERVER_PORT + 1; + } +#endif /* Would rather not do read_config before daemonization - * otherwise NOMMU machines will parse config twice */ read_config(argv[0] ? argv[0] : DHCPD_CONF_FILE); |