|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT/LWIP PATCH 1/3] Try to get IP address from device
Hey Costin,thanks for this patch. Please see my comments inline. I think we can earlier integrate this patch of the series to lwip. Thanks, Simon On 01.04.19 15:41, Costin Lupu wrote: IP addresses for netfront devices on Xen may be configured using Xenstore. Therefore we should first try to get IP address from device before taking it from elsewhere. Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx> --- init.c | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/init.c b/init.c index a5854b8..58fb173 100644 --- a/init.c +++ b/init.c @@ -38,11 +38,13 @@ #include "lwip/tcpip.h" #include "lwip/init.h" #include "lwip/dhcp.h" +#include "lwip/inet.h" #if CONFIG_LWIP_NOTHREADS #include "lwip/timeouts.h" #else /* CONFIG_LWIP_NOTHREADS */ #include <uk/semaphore.h> #endif /* CONFIG_LWIP_NOTHREADS */ +#include <uk/netdev_core.h> #include "netif/uknetdev.h"#if LWIP_NETIF_EXT_STATUS_CALLBACK && CONFIG_LWIP_NETIF_STATUS_PRINT I would go for a default mask (Class C for instance), if we don't got one but have an IP. Of course we should fail if we could not parse the mask but the absence of one I would go for a default one. + + strcfg = uk_netdev_einfo_get(dev, UK_NETDEV_IPV4_GW_STR); + if (!strcfg) + goto no_conf; + if (ip4addr_aton(strcfg, &gw4) != 1) + goto no_conf; + Not having a gateway is a reasonable configuration. We just set it to NULL and lwip should handle it properly. We should still setup the given IP and gateway instead of considering this as no_conf. _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |