From 8e8a348fd4139e2b9c6a3fa51d3fb35c4523795f Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 21 Nov 2008 19:45:05 +0000 Subject: [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. --- src/arch/i386/image/pxe_image.c | 6 ++++-- 1 file 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 */ -- cgit v1.2.3-55-g7522