svn commit: trunk/busybox: include networking/udhcp

vda at busybox.net vda at busybox.net
Wed Aug 15 20:03:38 UTC 2007


Author: vda
Date: 2007-08-15 13:03:36 -0700 (Wed, 15 Aug 2007)
New Revision: 19516

Log:
dhcpd: make -S and -f actually work



Modified:
   trunk/busybox/include/usage.h
   trunk/busybox/networking/udhcp/dhcpd.c


Changeset:
Modified: trunk/busybox/include/usage.h
===================================================================
--- trunk/busybox/include/usage.h	2007-08-15 15:47:51 UTC (rev 19515)
+++ trunk/busybox/include/usage.h	2007-08-15 20:03:36 UTC (rev 19516)
@@ -3676,6 +3676,7 @@
        "[-fS] [configfile]" \
 
 #define udhcpd_full_usage \
+       "DHCP server" \
        "\n	-f	Stay in foreground" \
        "\n	-S	Log to syslog too"
 

Modified: trunk/busybox/networking/udhcp/dhcpd.c
===================================================================
--- trunk/busybox/networking/udhcp/dhcpd.c	2007-08-15 15:47:51 UTC (rev 19515)
+++ trunk/busybox/networking/udhcp/dhcpd.c	2007-08-15 20:03:36 UTC (rev 19516)
@@ -37,6 +37,7 @@
 	struct dhcpOfferedAddr *lease, static_lease;
 
 	opt = getopt32(argc, argv, "fS");
+	argv += optind;
 
 	if (!(opt & 1)) { /* no -f */
 		bb_daemonize_or_rexec(0, argv);
@@ -50,7 +51,7 @@
 
 	/* Would rather not do read_config before daemonization -
 	 * otherwise NOMMU machines will parse config twice */
-	read_config(argv[1] ? argv[1] : DHCPD_CONF_FILE);
+	read_config(argv[0] ? argv[0] : DHCPD_CONF_FILE);
 
 	/* Make sure fd 0,1,2 are open */
 	bb_sanitize_stdio();




More information about the busybox-cvs mailing list