Browse Source

[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.
tags/v0.9.6
Michael Brown 15 years ago
parent
commit
8e8a348fd4
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/arch/i386/image/pxe_image.c

+ 4
- 2
src/arch/i386/image/pxe_image.c View File

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

Loading…
Cancel
Save