[pxe] Select the correct network device on multiport cards

When trying to find the "first open network device", it helps to
actually check the NETDEV_OPEN flag.
This commit is contained in:
Michael Brown
2008-11-21 19:45:05 +00:00
parent 246ddf5ee4
commit 8e8a348fd4

View File

@@ -51,8 +51,10 @@ static int pxe_exec ( struct image *image ) {
/* Arbitrarily pick the first open network device to use for PXE */ /* Arbitrarily pick the first open network device to use for PXE */
for_each_netdev ( netdev ) { for_each_netdev ( netdev ) {
pxe_set_netdev ( netdev ); if ( netdev->state & NETDEV_OPEN ) {
break; pxe_set_netdev ( netdev );
break;
}
} }
/* Many things will break if pxe_netdev is NULL */ /* Many things will break if pxe_netdev is NULL */