summaryrefslogtreecommitdiffstats
path: root/src/usr/autoboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/autoboot.c')
-rw-r--r--src/usr/autoboot.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c
index c1a61ec0..cff6e95d 100644
--- a/src/usr/autoboot.c
+++ b/src/usr/autoboot.c
@@ -38,6 +38,9 @@
*
*/
+/** Time to wait for link-up */
+#define LINK_WAIT_MS 15000
+
/**
* Identify the boot network device
*
@@ -136,6 +139,14 @@ static int netboot ( struct net_device *netdev ) {
return rc;
ifstat ( netdev );
+ /* Wait for link-up */
+ printf ( "Waiting for link-up on %s...", netdev->name );
+ if ( ( rc = iflinkwait ( netdev, LINK_WAIT_MS ) ) != 0 ) {
+ printf ( " no link detected\n" );
+ return rc;
+ }
+ printf ( " ok\n" );
+
/* Configure device via DHCP */
if ( ( rc = dhcp ( netdev ) ) != 0 )
return rc;