svn commit: trunk/busybox/networking

wberrier at busybox.net wberrier at busybox.net
Fri Nov 14 21:18:46 UTC 2008


Author: wberrier
Date: 2008-11-14 13:18:45 -0800 (Fri, 14 Nov 2008)
New Revision: 24043

Log:
ifupdown.c: allow options to udhcpc to be configurable from .config

This allows more control over options that are passed to udhcpc
that are not configurable via /etc/network/interfaces.

Example: rather than quit when an initial lease isn't found,
you could use "--background" so that udhcpc keeps running and
continually attempts to get an ip.  That way, when you plug in
the ethernet after powering on the device, you'll still get an ip.

Modified:
   trunk/busybox/networking/Config.in
   trunk/busybox/networking/ifupdown.c


Changeset:
Modified: trunk/busybox/networking/Config.in
===================================================================
--- trunk/busybox/networking/Config.in	2008-11-14 13:39:58 UTC (rev 24042)
+++ trunk/busybox/networking/Config.in	2008-11-14 21:18:45 UTC (rev 24043)
@@ -858,6 +858,15 @@
 
 source networking/udhcp/Config.in
 
+config IFUPDOWN_UDHCPC_CMD_OPTIONS
+	string "ifup udhcpc command line options"
+	default "-R -n"
+	depends on IFUPDOWN && APP_UDHCPC
+	help
+	  Command line options to pass to udhcpc from ifup.
+	  Intended to alter options not available in /etc/network/interfaces.
+	  (IE: --syslog --background etc...)
+
 config VCONFIG
 	bool "vconfig"
 	default n

Modified: trunk/busybox/networking/ifupdown.c
===================================================================
--- trunk/busybox/networking/ifupdown.c	2008-11-14 13:39:58 UTC (rev 24042)
+++ trunk/busybox/networking/ifupdown.c	2008-11-14 21:18:45 UTC (rev 24043)
@@ -31,6 +31,8 @@
 #define MAX_INTERFACE_LENGTH 10
 #endif
 
+#define UDHCPC_CMD_OPTIONS CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS
+
 #define debug_noise(args...) /*fprintf(stderr, args)*/
 
 /* Forward declaration */
@@ -487,7 +489,7 @@
 		"pump -i %iface% -k",
 	},
 	{ "udhcpc",
-		"udhcpc -R -n -p /var/run/udhcpc.%iface%.pid -i %iface%[[ -H %hostname%]][[ -c %clientid%]]"
+		"udhcpc " UDHCPC_CMD_OPTIONS " -p /var/run/udhcpc.%iface%.pid -i %iface%[[ -H %hostname%]][[ -c %clientid%]]"
 				"[[ -s %script%]][[ %udhcpc_opts%]]",
 		"kill `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null",
 	},
@@ -526,7 +528,7 @@
 	if (!execute("ifconfig %iface%[[ hw %hwaddress%]] up", ifd, exec))
 		return 0;
 #endif
-	return execute("udhcpc -R -n -p /var/run/udhcpc.%iface%.pid "
+	return execute("udhcpc " UDHCPC_CMD_OPTIONS " -p /var/run/udhcpc.%iface%.pid "
 			"-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]][[ %udhcpc_opts%]]",
 			ifd, exec);
 }




More information about the busybox-cvs mailing list