[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


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Thu, 22 Aug 2019 15:24:17 +0300
  • Cc: felipe.huici@xxxxxxxxx, charalampos.mainas@xxxxxxxxx, Bogdan Lascu <lascu.bogdan96@xxxxxxxxx>
  • Delivery-date: Thu, 22 Aug 2019 12:24:27 +0000
  • Ironport-phdr: 9a23:GLxxHRbuP6a2+LF0pnkV+Uz/LSx+4OfEezUN459isYplN5qZrsSzbnLW6fgltlLVR4KTs6sC17OM9fm8BydYsd6oizMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCybL9vMhm6txjdu8YXjIdtNqo8yQbCr2dVdehR2W5mP0+YkQzm5se38p5j8iBQtOwk+sVdT6j0fLk2QKJBAjg+PG87+MPktR/YTQuS/XQcSXkZkgBJAwfe8h73WIr6vzbguep83CmaOtD2TawxVD+/4apnVAPkhSEaPDMi7mrZltJ/g75aoBK5phxw3YjUYJ2ONPFjeq/RZM4WSXZdUspUUSFKH4GyYJYVD+cZPehWsZTzqVUNoxW5HgSgGP/jxyVUinLswaE2z+IsGhzG0gw6GNIOtWzZocvyNKcJTeC1za/IxijFYfNLwTf99ZXDfxc9rvGLRrJwbcvRyU81GwPBk1WQsZHlMiiJ2eQWqWSb9/dgWvm1h249rAF8uz6izdovhInRno8Z11/J+ThjzIs2JdC0UlB3bcCmHZdKuSyWL5Z6T8w/T21yuys3yqcKtYC1cSUE0pgr2hHSZ+KBfoOV+BzsTvyRLi19hH99fbK/gAu9/la4x+3nU8m0zE5Kri1YktnQrnwN1wLc6syASvZl4Eeh3CyA1wHX6u1ePU80jrDXK4Y8wrErjJYTq0PDEjf3mEXwkqCWal0p9vWn5uj6eLnrpZ+RO5Vqhg3gMKkigMKyDfw9MgcUXmib/eq81Kfk/U38WLhFkvo2krLFsJDbI8QXvKq5AxJN0oY+8BuwEyym3M4AnXkaN11JYgiHj4/xN1HUPP/4Feu/g0irkDpzw/DJJKbhDYnQLnTZi7jherl95FNGxwo1yd1S5olZCr4EIP3pW0/xsMbUAQM+Mwyx2+znEsly1psCWWKTBa+UKKbSsV6O5uIuJOmMf5YZtyvjJPg7+fHuiWQ0mVscfamywZsXc2q0H/t4LEWfe3bshc0BEWgStAokUOPqkEGCUSJUZ3uqQ6085is0CJi8AofHXI+thaSB3CCgHpFMY2BJEFGMEXHyeIWfQPoMbjydLdNlkjMeTretUZEu1Qy2vg/g17VnNvbU+jEftZ/72th6+enTlRAq9TNqFcid03yNT2BokWMJXDI22r5wrlB5yliZyqd0meJXFcEAr89OBwI7M5/b1Kl2Bs7/XirFf8yVUxC2T9PgBis+HfwrxNpbSEFmB9SkxjTexzfiV7QSjKCKAtow77rB93PqYd5gwTDc0/9y3BEdXsJTODj+1eZE/A/JCtuMyh3Bmg==
  • Ironport-sdr: FFXvKV5ORxxAPtCGS61E+gYQBzIhDpKK6tYpFcLB01aweTq/X0WlHmdVd44muRYEJ9l5/oyyPv JvRG7865IzYA==
  • 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 |  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

 


Rackspace

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