[pxe] Select the correct network device on multiport cards
authorMichael Brown <mcb30@etherboot.org>
Fri, 21 Nov 2008 19:45:05 +0000 (19:45 +0000)
committerMichael Brown <mcb30@etherboot.org>
Fri, 21 Nov 2008 19:45:05 +0000 (19:45 +0000)
When trying to find the "first open network device", it helps to
actually check the NETDEV_OPEN flag.

src/arch/i386/image/pxe_image.c

index 77fa046..346d204 100644 (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 */