mirror of https://github.com/ipxe/ipxe.git
Ensure that pxe_netdev is set before starting up PXE NBP.
parent
cbd956535e
commit
071356d976
|
@ -38,7 +38,7 @@ struct image_type pxe_image_type __image_type ( PROBE_PXE );
|
||||||
* @v image PXE image
|
* @v image PXE image
|
||||||
* @ret rc Return status code
|
* @ret rc Return status code
|
||||||
*/
|
*/
|
||||||
static int pxe_exec ( struct image *image __unused ) {
|
static int pxe_exec ( struct image *image ) {
|
||||||
struct net_device *netdev;
|
struct net_device *netdev;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -52,6 +52,13 @@ static int pxe_exec ( struct image *image __unused ) {
|
||||||
break;
|
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 */
|
/* Start PXE NBP */
|
||||||
rc = pxe_start_nbp();
|
rc = pxe_start_nbp();
|
||||||
|
|
||||||
|
@ -80,8 +87,8 @@ int pxe_load ( struct image *image ) {
|
||||||
|
|
||||||
/* Verify and prepare segment */
|
/* Verify and prepare segment */
|
||||||
if ( ( rc = prep_segment ( buffer, filesz, memsz ) ) != 0 ) {
|
if ( ( rc = prep_segment ( buffer, filesz, memsz ) ) != 0 ) {
|
||||||
DBG ( "PXE image could not prepare segment: %s\n",
|
DBGC ( image, "IMAGE %p could not prepare segment: %s\n",
|
||||||
strerror ( rc ) );
|
image, strerror ( rc ) );
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue