[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.
pull/1/head
Michael Brown 2008-11-21 19:45:05 +00:00
parent 246ddf5ee4
commit 8e8a348fd4
1 changed files with 4 additions and 2 deletions

View File

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