diff options
Diffstat (limited to 'src/usr/iscsiboot.c')
-rw-r--r-- | src/usr/iscsiboot.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/usr/iscsiboot.c b/src/usr/iscsiboot.c index e0098fd2c..cdf7790bb 100644 --- a/src/usr/iscsiboot.c +++ b/src/usr/iscsiboot.c @@ -26,11 +26,12 @@ struct setting keep_san_setting __setting = { * @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; |