summaryrefslogtreecommitdiff
path: root/networking/ifupdown.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-07-21 14:57:54 +0000
committerDenis Vlasenko2007-07-21 14:57:54 +0000
commit6cd84dac84f72dde437790cc620c8638d3591d00 (patch)
tree1c822ba1859d04ab9af79210d7f331207738ed7b /networking/ifupdown.c
parente8feca085dbcd0fb97aa5af1a8e751affb88df48 (diff)
downloadbusybox-6cd84dac84f72dde437790cc620c8638d3591d00.zip
busybox-6cd84dac84f72dde437790cc620c8638d3591d00.tar.gz
Three patches from FreeWRT people
Diffstat (limited to 'networking/ifupdown.c')
-rw-r--r--networking/ifupdown.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 5aa3fa5..a15e141 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -484,7 +484,12 @@ static const struct dhcp_client_t ext_dhcp_clients[] = {
static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
- int i ;
+#if ENABLE_FEATURE_IFUPDOWN_IP
+ /* ip doesn't up iface when it configures it (unlike ifconfig) */
+ if (!execute("ip link set %iface% up", ifd, exec))
+ return 0;
+#endif
+ int i;
for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) {
if (exists_execable(ext_dhcp_clients[i].name))
return execute(ext_dhcp_clients[i].startcmd, ifd, exec);
@@ -492,6 +497,11 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
bb_error_msg("no dhcp clients found");
return 0;
#elif ENABLE_APP_UDHCPC
+#if ENABLE_FEATURE_IFUPDOWN_IP
+ /* ip doesn't up iface when it configures it (unlike ifconfig) */
+ if (!execute("ip link set %iface% up", ifd, exec))
+ return 0;
+#endif
return execute("udhcpc -R -n -p /var/run/udhcpc.%iface%.pid "
"-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]]",
ifd, exec);
@@ -503,7 +513,7 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
- int i ;
+ int i;
for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) {
if (exists_execable(ext_dhcp_clients[i].name))
return execute(ext_dhcp_clients[i].stopcmd, ifd, exec);