[gPXE-devel] [PATCH] Fix autoboot for multiple NIC's on different networks
Joshua Oreman
oremanj at rwcr.net
Wed Jul 7 12:21:21 EDT 2010
On Wed, Jul 7, 2010 at 8:35 AM, Gianni Tedesco
<gianni.tedesco at citrix.com> wrote:
> Hi,
>
> Without this patch retrieving boot image from the second "next-server"
> and "filename" actually ends up using the results obtained from DHCP on
> the first NIC after boot either fails or continues.
I'm not convinced that this patch is correct. I think you want to
clear the netX/filename and netX/root-path settings after a boot from
netX fails, but still allow global filename and root-path settings to
override them (which is the current behavior).
Also, the extra netdev_close() is almost certainly not correct,
because boot_netdev can be NULL at that point.
-- Josh
>
> Signed-off-by: Gianni Tedesco <gianni.tedesco at citrix.com>
>
> src/usr/autoboot.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c
> index d76751b..439860e 100644
> --- a/src/usr/autoboot.c
> +++ b/src/usr/autoboot.c
> @@ -171,8 +171,8 @@ static int netboot ( struct net_device *netdev ) {
> }
>
> /* Try to download and boot whatever we are given as a filename */
> - fetch_ipv4_setting ( NULL, &next_server_setting, &next_server );
> - fetch_string_setting ( NULL, &filename_setting, buf, sizeof ( buf ) );
> + fetch_ipv4_setting ( netdev_settings(netdev), &next_server_setting,
> &next_server );
> + fetch_string_setting ( netdev_settings(netdev), &filename_setting,
> buf, sizeof ( buf ) );
> if ( buf[0] ) {
> printf ( "Booting from filename \"%s\"\n", buf );
> if ( ( rc = boot_next_server_and_filename ( next_server,
> @@ -228,6 +228,8 @@ void autoboot ( void ) {
> if ( ( boot_netdev = find_boot_netdev() ) )
> netboot ( boot_netdev );
>
> + netdev_close(boot_netdev);
> +
> /* If that fails, try booting from any of the other devices */
> for_each_netdev ( netdev ) {
> if ( netdev == boot_netdev )
>
>
> _______________________________________________
> gPXE-devel mailing list
> gPXE-devel at etherboot.org
> http://etherboot.org/mailman/listinfo/gpxe-devel
>
More information about the gPXE-devel
mailing list