mirror of
https://github.com/ipxe/ipxe
synced 2025-12-21 20:40:25 +03:00
[hacks] Improve the guess_boot_netdev() logic
This function is a major kludge, but can be made slightly more accurate by ignoring net devices that aren't open. Eventually it needs to be removed entirely.
This commit is contained in:
@@ -372,11 +372,12 @@ static int nbi_boot32 ( struct image *image, struct imgheader *imgheader ) {
|
||||
* @ret netdev Boot network device
|
||||
*/
|
||||
static struct net_device * guess_boot_netdev ( void ) {
|
||||
struct net_device *boot_netdev;
|
||||
struct net_device *netdev;
|
||||
|
||||
/* Just use the first network device */
|
||||
for_each_netdev ( boot_netdev ) {
|
||||
return boot_netdev;
|
||||
for_each_netdev ( netdev ) {
|
||||
if ( netdev->state & NETDEV_OPEN )
|
||||
return netdev;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user