diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-04 13:12:16 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-04 13:12:16 +0000 |
commit | d55fe3e595eb0aad60484d273e251cfee4ef8aa5 (patch) | |
tree | 1b9ff57d70411902db36582da8dbaded99485eeb /networking/udhcp/dhcpd.c | |
parent | e8ef7ec7de0cd9906b42a94eddb800ed1229a614 (diff) | |
download | busybox-w32-d55fe3e595eb0aad60484d273e251cfee4ef8aa5.tar.gz busybox-w32-d55fe3e595eb0aad60484d273e251cfee4ef8aa5.tar.bz2 busybox-w32-d55fe3e595eb0aad60484d273e251cfee4ef8aa5.zip |
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 45f445b48..eb7323da7 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <syslog.h> | 13 | #include <syslog.h> |
14 | #include "common.h" | 14 | #include "common.h" |
15 | #include "dhcpc.h" | ||
15 | #include "dhcpd.h" | 16 | #include "dhcpd.h" |
16 | #include "options.h" | 17 | #include "options.h" |
17 | 18 | ||
@@ -35,8 +36,14 @@ int udhcpd_main(int argc, char **argv) | |||
35 | unsigned opt; | 36 | unsigned opt; |
36 | struct option_set *option; | 37 | struct option_set *option; |
37 | struct dhcpOfferedAddr *lease, static_lease; | 38 | struct dhcpOfferedAddr *lease, static_lease; |
39 | USE_FEATURE_UDHCP_PORT(char *str_P;) | ||
38 | 40 | ||
39 | opt = getopt32(argv, "fS"); | 41 | #if ENABLE_FEATURE_UDHCP_PORT |
42 | SERVER_PORT = 67; | ||
43 | CLIENT_PORT = 68; | ||
44 | #endif | ||
45 | |||
46 | opt = getopt32(argv, "fS" USE_FEATURE_UDHCP_PORT("P:", &str_P)); | ||
40 | argv += optind; | 47 | argv += optind; |
41 | 48 | ||
42 | if (!(opt & 1)) { /* no -f */ | 49 | if (!(opt & 1)) { /* no -f */ |
@@ -48,7 +55,12 @@ int udhcpd_main(int argc, char **argv) | |||
48 | openlog(applet_name, LOG_PID, LOG_LOCAL0); | 55 | openlog(applet_name, LOG_PID, LOG_LOCAL0); |
49 | logmode |= LOGMODE_SYSLOG; | 56 | logmode |= LOGMODE_SYSLOG; |
50 | } | 57 | } |
51 | 58 | #if ENABLE_FEATURE_UDHCP_PORT | |
59 | if (opt & 4) { /* -P */ | ||
60 | SERVER_PORT = xatou16(str_P); | ||
61 | CLIENT_PORT = SERVER_PORT + 1; | ||
62 | } | ||
63 | #endif | ||
52 | /* Would rather not do read_config before daemonization - | 64 | /* Would rather not do read_config before daemonization - |
53 | * otherwise NOMMU machines will parse config twice */ | 65 | * otherwise NOMMU machines will parse config twice */ |
54 | read_config(argv[0] ? argv[0] : DHCPD_CONF_FILE); | 66 | read_config(argv[0] ? argv[0] : DHCPD_CONF_FILE); |