[sr-dev] git:5.1:31ee7514: core: workaround related to T_OPT for alpine linux musl C library (GH #2095)

Henning Westerholt hw at skalatan.de
Mon Oct 7 16:35:57 CEST 2019


Module: kamailio
Branch: 5.1
Commit: 31ee751409e0efdace1f76ee78cc85da78b049b8
URL: https://github.com/kamailio/kamailio/commit/31ee751409e0efdace1f76ee78cc85da78b049b8

Author: Henning Westerholt <hw at skalatan.de>
Committer: Henning Westerholt <hw at skalatan.de>
Date: 2019-10-07T16:35:44+02:00

core: workaround related to T_OPT for alpine linux musl C library (GH #2095)

(cherry picked from commit cec1043a9c4daa39b4245b87f28fb5566e8627bd)

---

Modified: src/core/resolve.c

---

Diff:  https://github.com/kamailio/kamailio/commit/31ee751409e0efdace1f76ee78cc85da78b049b8.diff
Patch: https://github.com/kamailio/kamailio/commit/31ee751409e0efdace1f76ee78cc85da78b049b8.patch

---

diff --git a/src/core/resolve.c b/src/core/resolve.c
index 439435791a..f12b6e1ca6 100644
--- a/src/core/resolve.c
+++ b/src/core/resolve.c
@@ -32,8 +32,12 @@
 #include <resolv.h>
 #include <string.h>
 
-/* older glibc < 2.25 does not include T_OPT in nameser_compat.h yet */
-#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 25
+/*
+ * Older glibc < 2.25 does not include T_OPT in nameser_compat.h yet.
+ * On alpine linux musl library it is also not defined. There is no
+ * musl feature test macro, so we look for glibc instead.
+ */
+#if (defined __GLIBC__ &&  __GLIBC__ == 2 && __GLIBC_MINOR__ < 25) || !defined __GLIBC__
 #ifndef T_OPT
 #define T_OPT ns_t_opt
 #endif




More information about the sr-dev mailing list