|
@@ -28,6 +28,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
28
|
28
|
#include <usr/ifmgmt.h>
|
29
|
29
|
#include <usr/dhcpmgmt.h>
|
30
|
30
|
|
|
31
|
+#define LINK_WAIT_MS 15000
|
|
32
|
+
|
31
|
33
|
/** @file
|
32
|
34
|
*
|
33
|
35
|
* DHCP management
|
|
@@ -41,6 +43,10 @@ int dhcp ( struct net_device *netdev ) {
|
41
|
43
|
if ( ( rc = ifopen ( netdev ) ) != 0 )
|
42
|
44
|
return rc;
|
43
|
45
|
|
|
46
|
+ /* Wait for link-up */
|
|
47
|
+ if ( ( rc = iflinkwait ( netdev, LINK_WAIT_MS ) ) != 0 )
|
|
48
|
+ return rc;
|
|
49
|
+
|
44
|
50
|
/* Perform DHCP */
|
45
|
51
|
printf ( "DHCP (%s %s)", netdev->name, netdev_hwaddr ( netdev ) );
|
46
|
52
|
if ( ( rc = start_dhcp ( &monojob, netdev ) ) == 0 )
|