]> xenbits.xensource.com Git - unikraft/libs/lwip.git/commitdiff
netdb: Prefer musl data types if available
authorSimon Kuenzer <simon@unikraft.io>
Sun, 4 Feb 2024 14:29:29 +0000 (15:29 +0100)
committerRazvan Deaconescu <razvan.deaconescu@upb.ro>
Fri, 9 Feb 2024 20:30:17 +0000 (22:30 +0200)
For better ABI compatibility and interopability, the data types that
are defined in `<lwip/netdb.h>` are replaced by the ones shipped with
the musl library (`<netdb.h>`) if available.

Signed-off-by: Simon Kuenzer <simon@unikraft.io>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #48

include/lwipopts.h

index a79d6178ba8cc2745cb6fa459ea8a1830d7a7278..66c26f3f3ee649c395e1ed2e717c5ebde603f5c8 100644 (file)
@@ -265,6 +265,15 @@ void sys_free(void *ptr);
 #define DNS_TABLE_SIZE CONFIG_LWIP_DNS_TABLE_SIZE
 #define DNS_LOCAL_HOST_LIST 1
 #define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 1
+
+#if CONFIG_LIBMUSL_NETWORK
+/* lwip should not declare its own data types */
+#define LWIP_DNS_API_DECLARE_H_ERRNO  0
+#define LWIP_DNS_API_DEFINE_ERRORS    0
+#define LWIP_DNS_API_DEFINE_FLAGS     0
+#define LWIP_DNS_API_DECLARE_STRUCTS  0
+#include <netdb.h>
+#endif /* CONFIG_LIBMUSL_NETWORK */
 #endif /* LWIP_DNS */
 
 /**