]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[netdevice] Allow network device to update link state before checking
authorMichael Brown <mcb30@ipxe.org>
Sat, 21 Apr 2012 15:25:55 +0000 (16:25 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sat, 21 Apr 2012 15:28:29 +0000 (16:28 +0100)
If the network interface has only just been opened (e.g. by the "dhcp"
command) then we should allow at least one opportunity for the card to
update the link state before testing it, to avoid false positives.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/usr/ifmgmt.c

index 049851596da0514d1a8cd9077d3d950f73362872..8ee311c0f68966d54d8222d8248878f3675697c9 100644 (file)
@@ -113,6 +113,9 @@ int iflinkwait ( struct net_device *netdev, unsigned int max_wait_ms ) {
        int key;
        int rc;
 
+       /* Allow link state to be updated */
+       netdev_poll ( netdev );
+
        if ( netdev_link_ok ( netdev ) )
                return 0;