[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT/LWIP PATCH] Define getaddrinfo() and freeaddrinfo() as functions instead of wrappers
From: Bogdan Lascu <lascu.bogdan96@xxxxxxxxx> Commit 28138d6d added getaddrinfo() and freeaddrinfo() as wrappers. However, it's not necessary for a source file to include the netdb.h header where they are defined when it uses them. So their definitions are needed as functions and not as macros. Signed-off-by: Bogdan Lascu <lascu.bogdan96@xxxxxxxxx> Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx> --- exportsyms.uk | 4 ++-- include/netdb.h | 4 ---- inet.c | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/exportsyms.uk b/exportsyms.uk index 9df9d0d..856ca8f 100644 --- a/exportsyms.uk +++ b/exportsyms.uk @@ -35,7 +35,7 @@ getservbyname getservbyport inet_ntop inet_pton -lwip_getaddrinfo -lwip_freeaddrinfo +getaddrinfo +freeaddrinfo gai_strerror getnameinfo diff --git a/include/netdb.h b/include/netdb.h index d650499..3c8c76d 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -6,10 +6,6 @@ #define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \ lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop) -#define freeaddrinfo(addrinfo) lwip_freeaddrinfo(addrinfo) -#define getaddrinfo(nodname, servname, hints, res) \ - lwip_getaddrinfo(nodname, servname, hints, res) - #endif /* LWIP_DNS && LWIP_SOCKET && !(LWIP_COMPAT_SOCKETS) */ struct servent { diff --git a/inet.c b/inet.c index bbb81a3..903b676 100644 --- a/inet.c +++ b/inet.c @@ -44,6 +44,20 @@ int inet_pton(int af, const char *src, void *dst) return lwip_inet_pton(af, src, dst); } +#if LWIP_DNS && LWIP_SOCKET && !(LWIP_COMPAT_SOCKETS) +int getaddrinfo(const char *node, const char *service, + const struct addrinfo *hints, + struct addrinfo **res) +{ + return lwip_getaddrinfo(node, service, hints, res); +} + +void freeaddrinfo(struct addrinfo *res) +{ + return lwip_freeaddrinfo(res); +} +#endif /* LWIP_DNS && LWIP_SOCKET && !(LWIP_COMPAT_SOCKETS) */ + /* Note: lwip implementation of getaddrinfo does not return all the errors * codes mentioned in its man page. */ -- 2.20.1 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |