summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2008-11-21 20:45:05 +0100
committerMichael Brown2008-11-21 20:45:05 +0100
commit8e8a348fd4139e2b9c6a3fa51d3fb35c4523795f (patch)
tree9a1bc70f6a6be8dbabf33eff585e279df5984fbf
parent[aoe] Use an AoE config query to identify the target MAC address (diff)
downloadipxe-8e8a348fd4139e2b9c6a3fa51d3fb35c4523795f.tar.gz
ipxe-8e8a348fd4139e2b9c6a3fa51d3fb35c4523795f.tar.xz
ipxe-8e8a348fd4139e2b9c6a3fa51d3fb35c4523795f.zip
[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.
-rw-r--r--src/arch/i386/image/pxe_image.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/arch/i386/image/pxe_image.c b/src/arch/i386/image/pxe_image.c
index 77fa0469..346d2048 100644
--- a/src/arch/i386/image/pxe_image.c
+++ b/src/arch/i386/image/pxe_image.c
@@ -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 */