[rtems-lwip commit] rtemslwip: Add gethostbyname wrapper

Joel Sherrill joel at rtems.org
Tue Mar 5 14:50:22 UTC 2024


Module:    rtems-lwip
Branch:    master
Commit:    09f628527c589eccca5b8f8811ffe717c1f10db0
Changeset: http://git.rtems.org/rtems-lwip/commit/?id=09f628527c589eccca5b8f8811ffe717c1f10db0

Author:    Kinsey Moore <kinsey.moore at oarcorp.com>
Date:      Wed Feb 28 12:28:20 2024 -0600

rtemslwip: Add gethostbyname wrapper

Applications and libraries compiled without the benefit of the lwIP
headers may require gethostbyname() instead of lwip_gethostbyname().
This wrapper allows those applicationns and libraries to link properly.

---

 rtemslwip/common/network_compat.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/rtemslwip/common/network_compat.c b/rtemslwip/common/network_compat.c
index c072d54..d99204c 100644
--- a/rtemslwip/common/network_compat.c
+++ b/rtemslwip/common/network_compat.c
@@ -58,6 +58,12 @@ uint16_t htons(uint16_t x)
   return lwip_htons(x);
 }
 
+#undef gethostbyname
+struct hostent *gethostbyname(const char *name)
+{
+  return lwip_gethostbyname(name);
+}
+
 int
 getnameinfo(const struct sockaddr *sa, socklen_t salen, char *node,
     size_t nodelen, char *service, size_t servicelen, int flags)



More information about the vc mailing list