]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[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 77fa0469a1c3e784c3a2350a1d7967178b1836ac..346d2048621bb4842a8894b82639eb4b7972ae91 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 */