diff options
author | Michael Brown <mcb30@etherboot.org> | 2007-07-03 00:02:26 +0100 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2007-07-03 00:02:26 +0100 |
commit | 071356d976e660cad9577f23107a6ca876cac32d (patch) | |
tree | 7536f8590002b6da6ea29a48a572c4dba8ea0364 /src | |
parent | cbd956535e500485fb9606cfc95eea0b40728a57 (diff) | |
download | ipxe-071356d976e660cad9577f23107a6ca876cac32d.zip ipxe-071356d976e660cad9577f23107a6ca876cac32d.tar.gz ipxe-071356d976e660cad9577f23107a6ca876cac32d.tar.bz2 |
Ensure that pxe_netdev is set before starting up PXE NBP.
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/i386/image/pxe_image.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/arch/i386/image/pxe_image.c b/src/arch/i386/image/pxe_image.c index c646929..3da38e0 100644 --- a/src/arch/i386/image/pxe_image.c +++ b/src/arch/i386/image/pxe_image.c @@ -38,7 +38,7 @@ struct image_type pxe_image_type __image_type ( PROBE_PXE ); * @v image PXE image * @ret rc Return status code */ -static int pxe_exec ( struct image *image __unused ) { +static int pxe_exec ( struct image *image ) { struct net_device *netdev; int rc; @@ -52,6 +52,13 @@ static int pxe_exec ( struct image *image __unused ) { break; } + /* Many things will break if pxe_netdev is NULL */ + if ( ! pxe_netdev ) { + DBGC ( image, "IMAGE %p could not locate PXE net device\n", + image ); + return -ENODEV; + } + /* Start PXE NBP */ rc = pxe_start_nbp(); @@ -80,8 +87,8 @@ int pxe_load ( struct image *image ) { /* Verify and prepare segment */ if ( ( rc = prep_segment ( buffer, filesz, memsz ) ) != 0 ) { - DBG ( "PXE image could not prepare segment: %s\n", - strerror ( rc ) ); + DBGC ( image, "IMAGE %p could not prepare segment: %s\n", + image, strerror ( rc ) ); return rc; } |