[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/LWIP PATCH v2] Define getaddrinfo() and freeaddrinfo() as functions instead of wrappers


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Fri, 23 Aug 2019 14:53:44 +0300
  • Cc: felipe.huici@xxxxxxxxx, charalampos.mainas@xxxxxxxxx, Bogdan Lascu <lascu.bogdan96@xxxxxxxxx>
  • Delivery-date: Fri, 23 Aug 2019 11:53:59 +0000
  • Ironport-phdr: 9a23:hxFLxxEBmckDha+sAeMGrZ1GYnF86YWxBRYc798ds5kLTJ7yr8WwAkXT6L1XgUPTWs2DsrQY0rCQ6vywEjBYqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba5sIBmssAncucobjYRtJ6ot1xDEvmZGd+NKyG1yOFmdhQz85sC+/J5i9yRfpfcs/NNeXKv5Yqo1U6VWACwpPG4p6sLrswLDTRaU6XsHTmoWiBtIDBPb4xz8Q5z8rzH1tut52CmdIM32UbU5Uims4qt3VBPljjoMOiUn+2/LlMN/kKNboAqgpxNhxY7UfJqVP+d6cq/EYN8WWXZNUsNXWidcAI2zcpEPAvIBM+hGsofzqVgAoxylCAWwGO/i0CNEi2Xq0aEm1ekqDAHI3BYnH9ILqHnZstL1NLwOUeC0yqnD0DPNb+5O2Tfg9YPFdQwuofaXXbJscMrRz1MjFwfYjlWItIzoJC+a1v8Xv2iD8upvTviji3QgqwxopDWk28QiipHRi44IxV3I6D91zYU1KNGiVkJ3f9ypHIFeui2CKod7Td4uT3trtSs60LEKp5C2cSYQxJg6yBPTdfqKeJWS7B35TuaeOzJ4iWpgeLK4mhm971Ctyvb5VsmoyFZKqTdFksXUunANyRPT7s+HR+Nj/kekwzmP1gTT5vtYLkAvj6bbM4MhzaUqmpoJtkTPBi72mEPog6+Kbkgo5+el5/n9brjlppKQLZF4hh/8P6g0lMGzGeE4PRIPX2if9+S8zrrj/UjhTbpWif02ibXZsJHcJcgBoq65HhdV0ps45hmjFDeqyswYnWQcI15fYhKHiJDlO0vSL/DgEfe/n1OsnS9vx//cJb3uHojNImLYn7fmcrZy9lRTyAw3wN1e/J9UBbQBL+jyWk/1rtDXEhg5Mwmsyeb9FNp9zp8eWX6IAqKBNaPSsFmI5uMoI+mXfYMapSjyK+Y76P7qlnI5nV4dfbK13ZsMcny5EeppI0ODbXrrmNcBHn8AvhAiQ+zylF2CTTlTam6uUKI8/D47EpipDYPZSYComLyB2zy7EodTZm9cC1CMF23nd56fVvcKdi2dPsthnSYfWrS7VYAhyAmktBXmxLp/MurU5ioYuIrt1Ndr4+3TlAky+iJuA8SdzmGNTn17nmITSj8wwq9wvUh9xU2Y3qRinfNYCI8b2/QcVwY8NJnHiuB3Fd32cgbAZcuSDkarRJOhGz5iYMg2xoolZF1hGtPqqg3bwmL+CLgOi72NQpgp6r/01GO3P9t3jWzBgvpyx2I6S9dCYDX1zpV08BLeUsuQyx2U
  • Ironport-sdr: +mIY0jXcOCX33tsi3jGjtWbvr8KuOcOm5hmTUTOhmPp5ZoKHuZEpqZvr0xz6Rzy9iPYHlGZdYs Dnnjr0nfZeYw==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

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 |  7 ++++---
 inet.c          | 14 ++++++++++++++
 3 files changed, 20 insertions(+), 5 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..0856a49 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -6,9 +6,10 @@
 #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)
+int getaddrinfo(const char *node, const char *service,
+               const struct addrinfo *hints,
+               struct addrinfo **res);
+void freeaddrinfo(struct addrinfo *res);
 
 #endif /* LWIP_DNS && LWIP_SOCKET && !(LWIP_COMPAT_SOCKETS) */
 
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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.