summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/dhcp.c5
-rw-r--r--mdk-stage1/network.c14
2 files changed, 14 insertions, 5 deletions
diff --git a/mdk-stage1/dhcp.c b/mdk-stage1/dhcp.c
index 9edae172d..230e8757b 100644
--- a/mdk-stage1/dhcp.c
+++ b/mdk-stage1/dhcp.c
@@ -175,8 +175,11 @@ static int initial_setup_interface(char * device, int s) {
}
/* I need to sleep a bit in order for kernel to finish init of the
- network device */
+ network device; this would allow to not send further multiple
+ dhcp requests when only one is needed. */
+ wait_message("Bringing up networking...");
sleep(2);
+ remove_wait_message();
return 0;
}
diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c
index 2b32ae615..dff02064a 100644
--- a/mdk-stage1/network.c
+++ b/mdk-stage1/network.c
@@ -167,10 +167,6 @@ int configure_net_device(struct interface_info * intf)
intf->is_up = 1;
- /* I need to sleep a bit in order for kernel to finish init of the
- network device; if not, first sendto() will get an EINVAL */
- sleep(2);
-
return 0;
}
@@ -421,6 +417,16 @@ static enum return_type setup_network_interface(struct interface_info * intf)
if (configure_net_device(intf))
return RETURN_ERROR;
+
+ if (intf->boot_proto == BOOTPROTO_STATIC) {
+ /* I need to sleep a bit in order for kernel to finish
+ init of the network device; if not, first sendto() for
+ gethostbyaddr will get an EINVAL. */
+ wait_message("Bringing up networking...");
+ sleep(2);
+ remove_wait_message();
+ }
+
return add_default_route();
}