diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c index 41b6d3f4..70b7e925 100644 --- a/src/usr/autoboot.c +++ b/src/usr/autoboot.c @@ -39,9 +39,6 @@ FILE_LICENCE ( GPL2_OR_LATER ); * */ -/** Time to wait for link-up */ -#define LINK_WAIT_MS 15000 - /** Shutdown flags for exit */ int shutdown_exit_flags = 0; @@ -153,10 +150,6 @@ static int netboot ( struct net_device *netdev ) { return rc; ifstat ( netdev ); - /* Wait for link-up */ - if ( ( rc = iflinkwait ( netdev, LINK_WAIT_MS ) ) != 0 ) - return rc; - /* Configure device via DHCP */ if ( ( rc = dhcp ( netdev ) ) != 0 ) return rc; diff --git a/src/usr/dhcpmgmt.c b/src/usr/dhcpmgmt.c index a0ac4c30..c1cc36ef 100644 --- a/src/usr/dhcpmgmt.c +++ b/src/usr/dhcpmgmt.c @@ -28,6 +28,8 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include +#define LINK_WAIT_MS 15000 + /** @file * * DHCP management @@ -41,6 +43,10 @@ int dhcp ( struct net_device *netdev ) { if ( ( rc = ifopen ( netdev ) ) != 0 ) return rc; + /* Wait for link-up */ + if ( ( rc = iflinkwait ( netdev, LINK_WAIT_MS ) ) != 0 ) + return rc; + /* Perform DHCP */ printf ( "DHCP (%s %s)", netdev->name, netdev_hwaddr ( netdev ) ); if ( ( rc = start_dhcp ( &monojob, netdev ) ) == 0 )