Automatically attach found network devices to the stack
during initialization.
+config LWIP_FAILNOIFACE
+ bool "Fail boot without netifs"
+ depends on LWIP_AUTOIFACE
+
choice
prompt "Operation mode"
default LWIP_THREADS
#else /* CONFIG_LWIP_NOTHREADS */
#include <uk/semaphore.h>
#endif /* CONFIG_LWIP_NOTHREADS */
+#include <errno.h>
#include <uk/netdev_core.h>
#include "netif/uknetdev.h"
#include <uk/init.h>
}
#endif /* !CONFIG_LWIP_NOTHREADS */
+static unsigned int lwip_netif_attached = 0;
+
/*
* This function initializing the lwip network stack
*/
devid);
continue;
}
+ lwip_netif_attached += 1;
/* Print hardware address */
if (nf->hwaddr_len == 6) {
}
#endif /* LWIP_IPV4 && LWIP_DHCP */
}
+
+ if (lwip_netif_attached == 0) {
+#if !CONFIG_LWIP_FAILNOIFACE
+ uk_pr_warn("No network interface attached!\n");
+#else /* CONFIG_LWIP_FAILNOIFACE */
+ uk_pr_crit("No network interface attached!\n");
+ return -ETIMEDOUT;
+#endif /* CONFIG_LWIP_FAILNOIFACE */
+ }
#endif /* CONFIG_LWIP_UKNETDEV && CONFIG_LWIP_AUTOIFACE */
return 0;
}