Hi ports@, This is update kamailio port.
Changelog: - update port to version 5.0.3 - regen pathes - fix set soname for shared library (fix load modules linked with srdb1,srdb2,trie,srutils on CLANG_ARCHS) Tested on current amd64. Ok? Comments?
Index: Makefile =================================================================== RCS file: /cvs/ports/telephony/kamailio/Makefile,v retrieving revision 1.41 diff -u -p -u -p -r1.41 Makefile --- Makefile 4 Jul 2017 08:29:27 -0000 1.41 +++ Makefile 10 Sep 2017 22:32:31 -0000 @@ -2,8 +2,7 @@ COMMENT-main = mature and flexible open source SIP server -VERSION = 5.0.2 -REVISION-main = 0 +VERSION = 5.0.3 DISTNAME = kamailio-${VERSION}_src @@ -49,7 +48,7 @@ LIB_DEPENDS-main = converters/libiconv \ net/curl \ textproc/libxml,-main,no_python -KAMAILIO_GROUPS = kstandard kcpl khttp_async koutbound ktls kutils kwebsocket kxmpp +KAMAILIO_GROUPS = kstandard kcpl khttp_async koutbound ktls kutils kwebsocket kxmpp FLAVOR ?= MULTI_PACKAGES = -main Index: distinfo =================================================================== RCS file: /cvs/ports/telephony/kamailio/distinfo,v retrieving revision 1.8 diff -u -p -u -p -r1.8 distinfo --- distinfo 3 Jul 2017 22:14:20 -0000 1.8 +++ distinfo 10 Sep 2017 22:32:31 -0000 @@ -1,2 +1,2 @@ -SHA256 (kamailio-5.0.2_src.tar.gz) = fxg7jHZjV3qwfh/7jCJumuPeKiUuAphETNBNreVwZPk= -SIZE (kamailio-5.0.2_src.tar.gz) = 11654459 +SHA256 (kamailio-5.0.3_src.tar.gz) = +nX3Oh1AxLorMy3mqk/pqqUxZ5NMb6rfoEJH0tMLVwo= +SIZE (kamailio-5.0.3_src.tar.gz) = 11678360 Index: patches/patch-src_Makefile_defs =================================================================== RCS file: /cvs/ports/telephony/kamailio/patches/patch-src_Makefile_defs,v retrieving revision 1.1 diff -u -p -u -p -r1.1 patch-src_Makefile_defs --- patches/patch-src_Makefile_defs 3 Jul 2017 22:14:20 -0000 1.1 +++ patches/patch-src_Makefile_defs 10 Sep 2017 22:32:31 -0000 @@ -14,7 +14,7 @@ Index: src/Makefile.defs alpha_macros= __alpha__ __alpha _M_ALPHA_ -@@ -867,16 +867,12 @@ ifeq ($(ARCH), i386) +@@ -879,16 +879,12 @@ ifeq ($(ARCH), i386) ifeq ($(CC_NAME), gcc) C_DEFS+=-DCC_GCC_LIKE_ASM #common stuff @@ -34,7 +34,7 @@ Index: src/Makefile.defs else #if gcc 4.0+ ifeq ($(CC_SHORTVER), 4.x) -@@ -924,8 +920,8 @@ else # CC_NAME, gcc +@@ -936,8 +932,8 @@ else # CC_NAME, gcc ifeq ($(CC_NAME), clang) $(call set_if_empty,CPUTYPE,athlon64) C_DEFS+=-DCC_GCC_LIKE_ASM @@ -45,7 +45,7 @@ Index: src/Makefile.defs else # CC_NAME, clang ifeq ($(CC_NAME), icc) C_DEFS+=-DCC_GCC_LIKE_ASM -@@ -949,7 +945,7 @@ ifeq ($(ARCH), x86_64) +@@ -961,7 +957,7 @@ ifeq ($(ARCH), x86_64) ifeq ($(CC_NAME), gcc) C_DEFS+=-DCC_GCC_LIKE_ASM #common stuff @@ -54,7 +54,7 @@ Index: src/Makefile.defs #if gcc 4.5+ # don't add '-mtune=$(CPUTYPE)' - gcc failure ifeq ($(CC_SHORTVER),$(filter $(CC_SHORTVER),4.5+ 5.0+ 6.0+)) -@@ -963,12 +959,8 @@ else +@@ -975,12 +971,8 @@ else #if gcc 4.2+ ifeq ($(CC_SHORTVER), 4.2+) $(call set_if_empty,CPUTYPE,opteron) @@ -69,7 +69,7 @@ Index: src/Makefile.defs else #if gcc 4.0+ ifeq ($(CC_SHORTVER), 4.x) -@@ -1017,9 +1009,8 @@ else # CC_NAME, gcc +@@ -1029,9 +1021,8 @@ else # CC_NAME, gcc ifeq ($(CC_NAME), clang) $(call set_if_empty,CPUTYPE,opteron) C_DEFS+=-DCC_GCC_LIKE_ASM Index: patches/patch-src_Makefile_libs =================================================================== RCS file: /cvs/ports/telephony/kamailio/patches/patch-src_Makefile_libs,v retrieving revision 1.1 diff -u -p -u -p -r1.1 patch-src_Makefile_libs --- patches/patch-src_Makefile_libs 3 Jul 2017 22:14:20 -0000 1.1 +++ patches/patch-src_Makefile_libs 10 Sep 2017 22:32:31 -0000 @@ -1,13 +1,14 @@ $OpenBSD: patch-src_Makefile_libs,v 1.1 2017/07/03 22:14:20 sthen Exp $ ---- src/Makefile.libs.orig Mon May 15 22:09:20 2017 -+++ src/Makefile.libs Mon May 15 22:15:55 2017 +Index: src/Makefile.libs +--- src/Makefile.libs.orig ++++ src/Makefile.libs @@ -52,12 +52,18 @@ ifeq ($(OS), darwin) -install_name $(LIB_INSTALL_NAME) else +ifeq ($(OS), openbsd) + LIB_NAME:=$(LIB_PREFIX)$(NAME)$(LIB_SUFFIX).$(OBSD_VER) -+ NAME_LD_FLAGS= $(LIB_SONAME)$(LIB_RUNTIME_NAME) ++ NAME_LD_FLAGS= $(LIB_SONAME)$(LIB_NAME) + LIBINAME_F:= +else LIB_NAME:=$(LIB_PREFIX)$(NAME)$(LIB_SUFFIX).$(MAJOR_VER).$(MINOR_VER) Index: patches/patch-src_core_core_cmd_c =================================================================== RCS file: patches/patch-src_core_core_cmd_c diff -N patches/patch-src_core_core_cmd_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_core_core_cmd_c 10 Sep 2017 22:32:31 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: src/core/core_cmd.c +--- src/core/core_cmd.c.orig ++++ src/core/core_cmd.c +@@ -943,7 +943,7 @@ static void core_sockets_list(rpc_t* rpc, void* c) + rpc->struct_add(ha, "ss", + "proto", get_proto_name(proto), + "address", si->name.s); +- if (!si->flags & SI_IS_IP) ++ if (!(si->flags & SI_IS_IP)) + rpc->struct_add(ha, "s", + "ipaddress", si->address_str.s); + rpc->struct_add(ha, "sss", Index: patches/patch-src_core_msg_translator_c =================================================================== RCS file: /cvs/ports/telephony/kamailio/patches/patch-src_core_msg_translator_c,v retrieving revision 1.1 diff -u -p -u -p -r1.1 patch-src_core_msg_translator_c --- patches/patch-src_core_msg_translator_c 3 Jul 2017 22:14:20 -0000 1.1 +++ patches/patch-src_core_msg_translator_c 10 Sep 2017 22:32:31 -0000 @@ -1,6 +1,7 @@ $OpenBSD: patch-src_core_msg_translator_c,v 1.1 2017/07/03 22:14:20 sthen Exp $ ---- src/core/msg_translator.c.orig Mon May 15 22:35:06 2017 -+++ src/core/msg_translator.c Mon May 15 22:42:28 2017 +Index: src/core/msg_translator.c +--- src/core/msg_translator.c.orig ++++ src/core/msg_translator.c @@ -522,7 +522,11 @@ static inline int lump_check_opt( struct lump *l, return 1; } @@ -13,7 +14,7 @@ $OpenBSD: patch-src_core_msg_translator_ LUMP_SET_COND_TRUE(l); return 1; } else return 0; -@@ -2317,6 +2321,7 @@ char * build_res_buf_from_sip_req( unsigned int code, +@@ -2320,6 +2324,7 @@ char * build_res_buf_from_sip_req( unsigned int code, body = 0; buf=0; Index: patches/patch-src_core_pt_c =================================================================== RCS file: /cvs/ports/telephony/kamailio/patches/patch-src_core_pt_c,v retrieving revision 1.1 diff -u -p -u -p -r1.1 patch-src_core_pt_c --- patches/patch-src_core_pt_c 3 Jul 2017 22:14:20 -0000 1.1 +++ patches/patch-src_core_pt_c 10 Sep 2017 22:32:31 -0000 @@ -1,7 +1,8 @@ $OpenBSD: patch-src_core_pt_c,v 1.1 2017/07/03 22:14:20 sthen Exp $ ---- src/core/pt.c.orig Mon May 15 22:43:07 2017 -+++ src/core/pt.c Mon May 15 22:48:08 2017 -@@ -245,8 +245,10 @@ int fork_process(int child_id, char *desc, int make_so +Index: src/core/pt.c +--- src/core/pt.c.orig ++++ src/core/pt.c +@@ -249,8 +249,10 @@ int fork_process(int child_id, char *desc, int make_so { int pid, child_process_no; int ret; @@ -12,9 +13,9 @@ $OpenBSD: patch-src_core_pt_c,v 1.1 2017 #ifdef USE_TCP int sockfd[2]; #endif -@@ -285,8 +287,10 @@ int fork_process(int child_id, char *desc, int make_so - - +@@ -289,8 +291,10 @@ int fork_process(int child_id, char *desc, int make_so + } + child_process_no = *process_count; +#ifndef HAVE_ARC4RANDOM new_seed1=kam_rand(); @@ -23,7 +24,7 @@ $OpenBSD: patch-src_core_pt_c,v 1.1 2017 pid = fork(); if (pid<0) { lock_release(process_lock); -@@ -301,9 +305,11 @@ int fork_process(int child_id, char *desc, int make_so +@@ -305,9 +309,11 @@ int fork_process(int child_id, char *desc, int make_so #ifdef USE_TCP close_extra_socks(child_id, process_no); #endif /* USE_TCP */ @@ -35,7 +36,7 @@ $OpenBSD: patch-src_core_pt_c,v 1.1 2017 shm_malloc_on_fork(); #ifdef PROFILING monstartup((u_long) &_start, (u_long) &etext); -@@ -380,8 +386,10 @@ int fork_tcp_process(int child_id, char *desc, int r, +@@ -384,8 +390,10 @@ int fork_tcp_process(int child_id, char *desc, int r, int reader_fd[2]; /* for comm. with the tcp children read */ int ret; int i; @@ -43,12 +44,12 @@ $OpenBSD: patch-src_core_pt_c,v 1.1 2017 unsigned int new_seed1; unsigned int new_seed2; +#endif - + /* init */ sockfd[0]=sockfd[1]=-1; -@@ -420,8 +428,10 @@ int fork_tcp_process(int child_id, char *desc, int r, - - +@@ -423,8 +431,10 @@ int fork_tcp_process(int child_id, char *desc, int r, + } + child_process_no = *process_count; +#ifndef HAVE_ARC4RANDOM new_seed1=kam_rand(); @@ -57,7 +58,7 @@ $OpenBSD: patch-src_core_pt_c,v 1.1 2017 pid = fork(); if (pid<0) { lock_release(process_lock); -@@ -443,9 +453,11 @@ int fork_tcp_process(int child_id, char *desc, int r, +@@ -446,9 +456,11 @@ int fork_tcp_process(int child_id, char *desc, int r, } } daemon_status_on_fork_cleanup(); Index: patches/patch-src_core_socket_info_c =================================================================== RCS file: patches/patch-src_core_socket_info_c diff -N patches/patch-src_core_socket_info_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_core_socket_info_c 10 Sep 2017 22:32:31 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: src/core/socket_info.c +--- src/core/socket_info.c.orig ++++ src/core/socket_info.c +@@ -1912,7 +1912,7 @@ void print_all_socket_lists() + printf(" %s: %s", + get_valid_proto_name(proto), + si->name.s); +- if (!si->flags & SI_IS_IP) ++ if (!(si->flags & SI_IS_IP)) + printf(" [%s]", si->address_str.s); + printf( ":%s%s%s", + si->port_no_str.s, Index: patches/patch-src_core_tcp_read_c =================================================================== RCS file: /cvs/ports/telephony/kamailio/patches/patch-src_core_tcp_read_c,v retrieving revision 1.1 diff -u -p -u -p -r1.1 patch-src_core_tcp_read_c --- patches/patch-src_core_tcp_read_c 3 Jul 2017 22:14:20 -0000 1.1 +++ patches/patch-src_core_tcp_read_c 10 Sep 2017 22:32:31 -0000 @@ -3,7 +3,7 @@ $OpenBSD: patch-src_core_tcp_read_c,v 1. Index: src/core/tcp_read.c --- src/core/tcp_read.c.orig +++ src/core/tcp_read.c -@@ -1497,6 +1497,14 @@ void release_tcpconn(struct tcp_connection* c, long st +@@ -1503,6 +1503,14 @@ void release_tcpconn(struct tcp_connection* c, long st ip_addr2a(&c->rcv.src_ip), c->rcv.src_port, ip_addr2a(&c->rcv.dst_ip), c->rcv.dst_port); LM_DBG("extra_data %p\n", c->extra_data); Index: patches/patch-src_main_c =================================================================== RCS file: /cvs/ports/telephony/kamailio/patches/patch-src_main_c,v retrieving revision 1.1 diff -u -p -u -p -r1.1 patch-src_main_c --- patches/patch-src_main_c 3 Jul 2017 22:14:20 -0000 1.1 +++ patches/patch-src_main_c 10 Sep 2017 22:32:31 -0000 @@ -2,7 +2,7 @@ $OpenBSD: patch-src_main_c,v 1.1 2017/07 Index: src/main.c --- src/main.c.orig +++ src/main.c -@@ -1845,8 +1845,10 @@ int main(int argc, char** argv) +@@ -1842,8 +1842,10 @@ int main(int argc, char** argv) int proto; char *options; int ret; @@ -13,7 +13,7 @@ Index: src/main.c int debug_save, debug_flag; int dont_fork_cnt; struct name_lst* n_lst; -@@ -2112,6 +2114,7 @@ int main(int argc, char** argv) +@@ -2109,6 +2111,7 @@ int main(int argc, char** argv) goto error; } @@ -21,7 +21,7 @@ Index: src/main.c /* seed the prng */ /* try to use /dev/urandom if possible */ seed=0; -@@ -2132,6 +2135,7 @@ try_again: +@@ -2129,6 +2132,7 @@ try_again: fastrand_seed(kam_rand()); srandom(kam_rand()+time(0)); LM_DBG("test random numbers %u %lu %u\n", kam_rand(), random(), fastrand()); Index: patches/patch-src_modules_nat_traversal_nat_traversal_c =================================================================== RCS file: /cvs/ports/telephony/kamailio/patches/patch-src_modules_nat_traversal_nat_traversal_c,v retrieving revision 1.1 diff -u -p -u -p -r1.1 patch-src_modules_nat_traversal_nat_traversal_c --- patches/patch-src_modules_nat_traversal_nat_traversal_c 3 Jul 2017 22:14:20 -0000 1.1 +++ patches/patch-src_modules_nat_traversal_nat_traversal_c 10 Sep 2017 22:32:31 -0000 @@ -3,7 +3,7 @@ $OpenBSD: patch-src_modules_nat_traversa Index: src/modules/nat_traversal/nat_traversal.c --- src/modules/nat_traversal/nat_traversal.c.orig +++ src/modules/nat_traversal/nat_traversal.c -@@ -1687,7 +1687,7 @@ restore_keepalive_state(void) +@@ -1691,7 +1691,7 @@ restore_keepalive_state(void) res = fscanf(f, STATE_FILE_HEADER); // skip header while (true) { Index: patches/patch-src_modules_rls_utils_c =================================================================== RCS file: /cvs/ports/telephony/kamailio/patches/patch-src_modules_rls_utils_c,v retrieving revision 1.1 diff -u -p -u -p -r1.1 patch-src_modules_rls_utils_c --- patches/patch-src_modules_rls_utils_c 3 Jul 2017 22:14:20 -0000 1.1 +++ patches/patch-src_modules_rls_utils_c 10 Sep 2017 22:32:31 -0000 @@ -10,13 +10,13 @@ Index: src/modules/rls/utils.c -str* normalize_sip_uri(const str *uri) +str* normalize_sip_uri(str *uri) { - static str normalized_uri; - static str null_str = {NULL, 0}; - static char buf[MAX_URI_SIZE]; + static str normalized_uri; + static str null_str = {NULL, 0}; + static char buf[MAX_URI_SIZE]; - normalized_uri.s = buf; -- if (un_escape((str *)uri, &normalized_uri) < 0) -+ if (un_escape(uri, &normalized_uri) < 0) - { - LM_ERR("un-escaping URI\n"); - return &null_str; + normalized_uri.s = buf; +- if (un_escape((str *)uri, &normalized_uri) < 0) ++ if (un_escape(uri, &normalized_uri) < 0) + { + LM_ERR("un-escaping URI\n"); + return &null_str; Index: patches/patch-src_modules_tls_tls_domain_c =================================================================== RCS file: patches/patch-src_modules_tls_tls_domain_c diff -N patches/patch-src_modules_tls_tls_domain_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_modules_tls_tls_domain_c 10 Sep 2017 22:32:32 -0000 @@ -0,0 +1,32 @@ +$OpenBSD$ + +Index: src/modules/tls/tls_domain.c +--- src/modules/tls/tls_domain.c.orig ++++ src/modules/tls/tls_domain.c +@@ -734,7 +734,7 @@ static void sr_ssl_ctx_info_callback(const SSL *ssl, i + if(data==0) + data = (struct tls_extra_data*)SSL_get_app_data(ssl); + LOG(tls_dbg, "SSL handshake done\n"); +-#if OPENSSL_VERSION_NUMBER < 0x010100000L ++#if OPENSSL_VERSION_NUMBER < 0x010100000L || defined(LIBRESSL_VERSION_NUMBER) + /* CVE-2009-3555 - disable renegotiation */ + if (ssl->s3) { + LOG(tls_dbg, "SSL disable renegotiation\n"); +@@ -858,7 +858,7 @@ static int tls_ssl_ctx_mode(SSL_CTX* ctx, long mode, v + */ + static int tls_ssl_ctx_set_freelist(SSL_CTX* ctx, long val, void* unused) + { +-#if OPENSSL_VERSION_NUMBER < 0x010100000L ++#if OPENSSL_VERSION_NUMBER < 0x010100000L || defined(LIBRESSL_VERSION_NUMBER) + if (val >= 0) + #if OPENSSL_VERSION_NUMBER >= 0x01000000L + #ifndef OPENSSL_NO_BUF_FREELISTS +@@ -997,7 +997,7 @@ static int fix_domain(tls_domain_t* d, tls_domain_t* d + memset(d->ctx, 0, sizeof(SSL_CTX*) * procs_no); + for(i = 0; i < procs_no; i++) { + +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + /* libssl < 1.1.0 */ + if(d->method>TLS_USE_TLSvRANGE) { + d->ctx[i] = SSL_CTX_new(SSLv23_method()); Index: patches/patch-src_modules_tls_tls_init_c =================================================================== RCS file: /cvs/ports/telephony/kamailio/patches/patch-src_modules_tls_tls_init_c,v retrieving revision 1.1 diff -u -p -u -p -r1.1 patch-src_modules_tls_tls_init_c --- patches/patch-src_modules_tls_tls_init_c 3 Jul 2017 22:14:20 -0000 1.1 +++ patches/patch-src_modules_tls_tls_init_c 10 Sep 2017 22:32:32 -0000 @@ -3,7 +3,16 @@ $OpenBSD: patch-src_modules_tls_tls_init Index: src/modules/tls/tls_init.c --- src/modules/tls/tls_init.c.orig +++ src/modules/tls/tls_init.c -@@ -139,7 +139,7 @@ const SSL_METHOD* ssl_methods[TLS_METHOD_MAX]; +@@ -119,7 +119,7 @@ to compile on the _target_ system)" + int openssl_kssl_malloc_bug=0; /* is openssl bug #1467 present ? */ + #endif + +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + const SSL_METHOD* ssl_methods[TLS_METHOD_MAX]; + #else + sr_tls_methods_t sr_tls_methods[TLS_METHOD_MAX]; +@@ -143,7 +143,7 @@ sr_tls_methods_t sr_tls_methods[TLS_METHOD_MAX]; */ @@ -12,7 +21,7 @@ Index: src/modules/tls/tls_init.c inline static char* buf_append(char* buf, char* end, char* str, int str_len) { if ( (buf+str_len)<end){ -@@ -317,6 +317,7 @@ static void ser_free(void *ptr, const char *fname, int +@@ -321,6 +321,7 @@ static void ser_free(void *ptr, const char *fname, int } #endif @@ -20,7 +29,16 @@ Index: src/modules/tls/tls_init.c /* * Initialize TLS socket -@@ -360,7 +361,7 @@ static void init_ssl_methods(void) +@@ -356,7 +357,7 @@ error: + */ + static void init_ssl_methods(void) + { +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + /* libssl < 1.1.0 */ + memset(ssl_methods, 0, sizeof(ssl_methods)); + +@@ -366,7 +367,7 @@ static void init_ssl_methods(void) ssl_methods[TLS_USE_SSLv23 - 1] = SSLv23_method(); /* only specific SSL or TLS version */ @@ -29,7 +47,7 @@ Index: src/modules/tls/tls_init.c #ifndef OPENSSL_NO_SSL2 ssl_methods[TLS_USE_SSLv2_cli - 1] = SSLv2_client_method(); ssl_methods[TLS_USE_SSLv2_srv - 1] = SSLv2_server_method(); -@@ -378,13 +379,13 @@ static void init_ssl_methods(void) +@@ -384,13 +385,13 @@ static void init_ssl_methods(void) ssl_methods[TLS_USE_TLSv1_srv - 1] = TLSv1_server_method(); ssl_methods[TLS_USE_TLSv1 - 1] = TLSv1_method(); @@ -45,7 +63,7 @@ Index: src/modules/tls/tls_init.c ssl_methods[TLS_USE_TLSv1_2_cli - 1] = TLSv1_2_client_method(); ssl_methods[TLS_USE_TLSv1_2_srv - 1] = TLSv1_2_server_method(); ssl_methods[TLS_USE_TLSv1_2 - 1] = TLSv1_2_method(); -@@ -393,11 +394,11 @@ static void init_ssl_methods(void) +@@ -399,11 +400,11 @@ static void init_ssl_methods(void) /* ranges of TLS versions (require a minimum TLS version) */ ssl_methods[TLS_USE_TLSv1_PLUS - 1] = (void*)TLS_OP_TLSv1_PLUS; @@ -58,8 +76,8 @@ Index: src/modules/tls/tls_init.c +#if OPENSSL_VERSION_NUMBER >= 0x1000105fL && !defined(LIBRESSL_VERSION_NUMBER) ssl_methods[TLS_USE_TLSv1_2_PLUS - 1] = (void*)TLS_OP_TLSv1_2_PLUS; #endif - } -@@ -408,6 +409,7 @@ static void init_ssl_methods(void) + +@@ -477,6 +478,7 @@ static void init_ssl_methods(void) */ static int init_tls_compression(void) { @@ -67,7 +85,7 @@ Index: src/modules/tls/tls_init.c #if OPENSSL_VERSION_NUMBER < 0x010100000L #if OPENSSL_VERSION_NUMBER >= 0x00908000L int n, r; -@@ -494,6 +496,7 @@ static int init_tls_compression(void) +@@ -563,6 +565,7 @@ static int init_tls_compression(void) end: #endif /* OPENSSL_VERSION_NUMBER >= 0.9.8 */ #endif /* OPENSSL_VERSION_NUMBER < 1.1.0 */ @@ -75,7 +93,7 @@ Index: src/modules/tls/tls_init.c return 0; } -@@ -504,6 +507,7 @@ end: +@@ -573,6 +576,7 @@ end: */ int tls_pre_init(void) { @@ -83,7 +101,7 @@ Index: src/modules/tls/tls_init.c #if OPENSSL_VERSION_NUMBER < 0x010100000L void *(*mf)(size_t) = NULL; void *(*rf)(void *, size_t) = NULL; -@@ -530,6 +534,7 @@ int tls_pre_init(void) +@@ -599,6 +603,7 @@ int tls_pre_init(void) " (can be loaded first to be safe)\n"); return -1; } @@ -91,7 +109,7 @@ Index: src/modules/tls/tls_init.c if (tls_init_locks()<0) return -1; -@@ -563,7 +568,7 @@ int init_tls_h(void) +@@ -632,7 +637,7 @@ int init_tls_h(void) { /*struct socket_info* si;*/ long ssl_version; @@ -100,7 +118,7 @@ Index: src/modules/tls/tls_init.c int lib_kerberos; int lib_zlib; int kerberos_support; -@@ -607,7 +612,7 @@ int init_tls_h(void) +@@ -676,7 +681,7 @@ int init_tls_h(void) } /* check kerberos support using compile flags only for version < 1.1.0 */ @@ -109,3 +127,12 @@ Index: src/modules/tls/tls_init.c #ifdef TLS_KERBEROS_SUPPORT kerberos_support=1; +@@ -847,7 +852,7 @@ void destroy_tls_h(void) + tls_destroy_cfg(); + tls_destroy_locks(); + tls_ct_wq_destroy(); +-#if OPENSSL_VERSION_NUMBER >= 0x010100000L ++#if OPENSSL_VERSION_NUMBER >= 0x010100000L && !defined(LIBRESSL_VERSION_NUMBER) + /* explicit execution of libssl cleanup to avoid being executed again + * by atexit(), when shm is gone */ + DBG("executing openssl v1.1+ cleanup\n"); Index: patches/patch-src_modules_tls_tls_init_h =================================================================== RCS file: patches/patch-src_modules_tls_tls_init_h diff -N patches/patch-src_modules_tls_tls_init_h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_modules_tls_tls_init_h 10 Sep 2017 22:32:32 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: src/modules/tls/tls_init.h +--- src/modules/tls/tls_init.h.orig ++++ src/modules/tls/tls_init.h +@@ -45,7 +45,7 @@ extern int openssl_kssl_malloc_bug; /* is openssl bug + #endif + + +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + extern const SSL_METHOD* ssl_methods[]; + #else + typedef struct sr_tls_methods_s { Index: patches/patch-src_modules_tls_tls_locking_c =================================================================== RCS file: patches/patch-src_modules_tls_tls_locking_c diff -N patches/patch-src_modules_tls_tls_locking_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_modules_tls_tls_locking_c 10 Sep 2017 22:32:32 -0000 @@ -0,0 +1,23 @@ +$OpenBSD$ + +Index: src/modules/tls/tls_locking.c +--- src/modules/tls/tls_locking.c.orig ++++ src/modules/tls/tls_locking.c +@@ -33,7 +33,7 @@ static int n_static_locks=0; + static gen_lock_set_t* static_locks=0; + + /* OpenSSL is thread-safe since 1.1.0 */ +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + + /* "dynamic" locks */ + +@@ -168,7 +168,7 @@ int tls_init_locks() + } + + /* OpenSSL is thread-safe since 1.1.0 */ +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) + /* set "dynamic" locks callbacks */ + CRYPTO_set_dynlock_create_callback(dyn_create_f); + CRYPTO_set_dynlock_lock_callback(dyn_lock_f); Index: patches/patch-src_modules_xhttp_pi_xhttp_pi_fnc_c =================================================================== RCS file: /cvs/ports/telephony/kamailio/patches/patch-src_modules_xhttp_pi_xhttp_pi_fnc_c,v retrieving revision 1.1 diff -u -p -u -p -r1.1 patch-src_modules_xhttp_pi_xhttp_pi_fnc_c --- patches/patch-src_modules_xhttp_pi_xhttp_pi_fnc_c 3 Jul 2017 22:14:20 -0000 1.1 +++ patches/patch-src_modules_xhttp_pi_xhttp_pi_fnc_c 10 Sep 2017 22:32:32 -0000 @@ -3,7 +3,7 @@ $OpenBSD: patch-src_modules_xhttp_pi_xht Index: src/modules/xhttp_pi/xhttp_pi_fnc.c --- src/modules/xhttp_pi/xhttp_pi_fnc.c.orig +++ src/modules/xhttp_pi/xhttp_pi_fnc.c -@@ -3189,7 +3189,7 @@ int ph_run_pi_cmd(pi_ctx_t* ctx) +@@ -3193,7 +3193,7 @@ int ph_run_pi_cmd(pi_ctx_t* ctx) val_str.len = max_page_len - ctx->reply.body.len; if(db_time2str(values[j].val.time_val, val_str.s, &val_str.len)!=0){ @@ -12,7 +12,7 @@ Index: src/modules/xhttp_pi/xhttp_pi_fnc values[j].val.time_val); goto error; } -@@ -3197,7 +3197,7 @@ int ph_run_pi_cmd(pi_ctx_t* ctx) +@@ -3201,7 +3201,7 @@ int ph_run_pi_cmd(pi_ctx_t* ctx) ctx->reply.body.len += val_str.len; if(link_on) XHTTP_PI_COPY_2(p,XHTTP_PI_SQUOT_GT,val_str); LM_DBG(" got %.*s[%d]=>" Index: patches/patch-utils_kamctl_kamdbctl_pgsql =================================================================== RCS file: patches/patch-utils_kamctl_kamdbctl_pgsql diff -N patches/patch-utils_kamctl_kamdbctl_pgsql --- patches/patch-utils_kamctl_kamdbctl_pgsql 3 Jul 2017 22:14:20 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,19 +0,0 @@ -$OpenBSD: patch-utils_kamctl_kamdbctl_pgsql,v 1.1 2017/07/03 22:14:20 sthen Exp $ - -kamctl: kamdbctl - proper use of DBPORT for postgres -https://github.com/kamailio/kamailio/commit/8cdee50d7c89c1617b68e2eff1ce646eba0c33fb - -Index: utils/kamctl/kamdbctl.pgsql ---- utils/kamctl/kamdbctl.pgsql.orig -+++ utils/kamctl/kamdbctl.pgsql -@@ -55,8 +55,8 @@ if [ -z "$DBPORT" ] ; then - CMD="psql -q -h $DBHOST -U $DBROOTUSER " - DUMP_CMD="pg_dump -h $DBHOST -U $DBROOTUSER -c" - else -- CMD="psql -q -h $DBHOST -p $DBHOST -U $DBROOTUSER " -- DUMP_CMD="pg_dump -h $DBHOST -p $DBHOST -U $DBROOTUSER -c" -+ CMD="psql -q -h $DBHOST -p $DBPORT -U $DBROOTUSER " -+ DUMP_CMD="pg_dump -h $DBHOST -p $DBPORT -U $DBROOTUSER -c" - fi - - #################################################################