TT#111601 remove already applied patches

mr9.4
Victor Seva 5 years ago
parent e3fe283bdc
commit d84c8a802a
No known key found for this signature in database
GPG Key ID: 2174A68E7DA82CC7

@ -32,19 +32,11 @@ sipwise/sca-debug.patch
sipwise/sca-fix-notify-after-bye.patch
sipwise/sca-add-pai_avp-parameter.patch
## backports from upstream (5.4)
upstream/0001-Revert-tls-proper-ifdef-on-libssl-version-for-tls_in.patch
upstream/0002-Revert-tls-added-define-condition-on-version-functio.patch
upstream/0003-Revert-tls-support-compilation-without-deprecated-Op.patch
upstream/pv_headers-fix-x_hdr-index-on-get.patch
upstream/ndb_redis-set-message-level-to-debug-on-exec.patch
upstream/secsipid-use-pkg-config-when-available.patch
upstream/secsipid-Makefile-detect-of-pkg-config-knows-about-l.patch
upstream/secsipid-include-secsipid.h-from-standard-path.patch
#
# upstream master (5.5)
upstream/permissions-basic-safety-for-concurent-rpc-reload.patch
upstream/permissions-add-reload_delta-parameter.patch
upstream/ndb_redis-set-message-level-to-debug-on-reconnect.patch
upstream/cfgt-log-info-when-node-is-created-and-saved.patch
### relevant for upstream
sipwise/pua_dialoginfo-refresh_pubruri_avps_flag.patch
sipwise/pua_dialoginfo-local_identity_dlg_var.patch
@ -54,7 +46,6 @@ sipwise/cfgt-skip-tm-vars-T_.patch
sipwise/cfgt-skip.patch
sipwise/rtpengine-codec-set-except.patch
sipwise/topos-don-t-insert-contact-header-for-4xx-replies.patch
sipwise/0001-sl-Fix-3xx-stats-RPC-marshalling.patch
sipwise/db_redis_skip_empty_keys.patch
sipwise/db_redis_graceful_scan.patch
sipwise/db_redis_sscan.patch

@ -1,26 +0,0 @@
From ac55cc5ce5fcbb50d3a2a6b228585dce8fc1150d Mon Sep 17 00:00:00 2001
From: Guillem Jover <gjover@sipwise.com>
Date: Thu, 5 Nov 2020 18:34:43 +0100
Subject: [PATCH] sl: Fix 3xx stats RPC marshalling
The struct_add() method was getting 4 values but only 3 "d".
---
src/modules/sl/sl_stats.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/sl/sl_stats.c b/src/modules/sl/sl_stats.c
index dd683eda5b..079786aade 100644
--- a/src/modules/sl/sl_stats.c
+++ b/src/modules/sl/sl_stats.c
@@ -73,7 +73,7 @@ static void rpc_stats(rpc_t* rpc, void* c)
"202", total.err[RT_202],
"2xx", total.err[RT_2xx]);
- rpc->struct_add(st, "ddd",
+ rpc->struct_add(st, "dddd",
"300", total.err[RT_300],
"301", total.err[RT_301],
"302", total.err[RT_302],
--
2.29.2

@ -1,38 +0,0 @@
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Wed, 2 Sep 2020 13:11:51 +0200
Subject: [PATCH 1/3] Revert "tls: proper ifdef on libssl version for
tls_init_locks()"
This reverts commit e9baba91c6c7e3d1817e8a07bbabbce3a8efbe79.
---
src/modules/tls/tls_locking.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/modules/tls/tls_locking.c b/src/modules/tls/tls_locking.c
index 21078e8..3eb6f03 100644
--- a/src/modules/tls/tls_locking.c
+++ b/src/modules/tls/tls_locking.c
@@ -140,7 +140,7 @@ unsigned long sr_ssl_id_f()
/* returns -1 on error, 0 on success */
int tls_init_locks()
{
-/* OpenSSL is no longer supporting to set locking callbacks since 1.1.0 */
+/* OpenSSL is thread-safe since 1.1.0 */
#if OPENSSL_VERSION_NUMBER < 0x10100000L
/* init "static" tls locks */
n_static_locks=CRYPTO_num_locks();
@@ -185,13 +185,10 @@ int tls_init_locks()
* (only atomic_inc), fallback to the default use-locks mode
* CRYPTO_set_add_lock_callback(atomic_add_f);
*/
+#endif
return 0;
error:
tls_destroy_locks();
return -1;
-
-#else
- return 0;
-#endif
}

@ -1,65 +0,0 @@
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Wed, 2 Sep 2020 13:12:06 +0200
Subject: [PATCH 2/3] Revert "tls: added define condition on version
functions"
This reverts commit 67979e07b63b574687b1924c38fabd724d0ad876.
---
src/modules/tls/tls_domain.c | 4 +---
src/modules/tls/tls_init.c | 11 +----------
2 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/src/modules/tls/tls_domain.c b/src/modules/tls/tls_domain.c
index 2930bde..fc84033 100644
--- a/src/modules/tls/tls_domain.c
+++ b/src/modules/tls/tls_domain.c
@@ -63,11 +63,9 @@ static void setup_ecdh(SSL_CTX *ctx)
{
EC_KEY *ecdh;
-#if OPENSSL_VERSION_NUMBER < 0x010100000L
- if (SSLeay() < 0x1000005fL) {
+ if (OpenSSL_version_num() < 0x1000005fL) {
return;
}
-#endif
ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
SSL_CTX_set_options(ctx, SSL_OP_SINGLE_ECDH_USE);
diff --git a/src/modules/tls/tls_init.c b/src/modules/tls/tls_init.c
index f10d0c0..351ed41 100644
--- a/src/modules/tls/tls_init.c
+++ b/src/modules/tls/tls_init.c
@@ -645,7 +645,6 @@ int tls_h_mod_init_f(void)
{
/*struct socket_info* si;*/
long ssl_version;
- const char *ssl_version_txt;
#if OPENSSL_VERSION_NUMBER < 0x010100000L && !defined(LIBRESSL_VERSION_NUMBER)
int lib_kerberos;
int lib_zlib;
@@ -668,15 +667,7 @@ int tls_h_mod_init_f(void)
#if OPENSSL_VERSION_NUMBER < 0x00907000L
LM_WARN("You are using an old version of OpenSSL (< 0.9.7). Upgrade!\n");
#endif
-
-#if OPENSSL_VERSION_NUMBER < 0x010100000L
- ssl_version=SSLeay();
- ssl_version_txt=SSLeay_version(SSLEAY_VERSION);
-#else
ssl_version=OpenSSL_version_num();
- ssl_version_txt=OpenSSL_version(OPENSSL_VERSION);
-#endif
-
/* check if version have the same major minor and fix level
* (e.g. 0.9.8a & 0.9.8c are ok, but 0.9.8 and 0.9.9x are not)
* - values is represented as 0xMMNNFFPPS: major minor fix patch status
@@ -688,7 +679,7 @@ int tls_h_mod_init_f(void)
" compiled \"%s\" (0x%08lx).\n"
" Please make sure a compatible version is used"
" (tls_force_run in kamailio.cfg will override this check)\n",
- ssl_version_txt, ssl_version,
+ OpenSSL_version(OPENSSL_VERSION), ssl_version,
OPENSSL_VERSION_TEXT, (long)OPENSSL_VERSION_NUMBER);
if (cfg_get(tls, tls_cfg, force_run))
LM_WARN("tls_force_run turned on, ignoring "

@ -1,124 +0,0 @@
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Wed, 2 Sep 2020 13:12:25 +0200
Subject: [PATCH 3/3] Revert "tls: support compilation without deprecated
OpenSSL APIs"
This reverts commit 10af8efa9061c2f52ee1db51c4cf665073c20dcc.
---
src/modules/tls/tls_domain.c | 4 +---
src/modules/tls/tls_init.c | 15 +++++++--------
src/modules/tls/tls_locking.c | 6 +++---
3 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/src/modules/tls/tls_domain.c b/src/modules/tls/tls_domain.c
index fc84033..a8859c4 100644
--- a/src/modules/tls/tls_domain.c
+++ b/src/modules/tls/tls_domain.c
@@ -27,8 +27,6 @@
#include <stdlib.h>
#include <openssl/ssl.h>
#include <openssl/opensslv.h>
-#include <openssl/bn.h>
-#include <openssl/dh.h>
#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
@@ -63,7 +61,7 @@ static void setup_ecdh(SSL_CTX *ctx)
{
EC_KEY *ecdh;
- if (OpenSSL_version_num() < 0x1000005fL) {
+ if (SSLeay() < 0x1000005fL) {
return;
}
diff --git a/src/modules/tls/tls_init.c b/src/modules/tls/tls_init.c
index 351ed41..b9288cb 100644
--- a/src/modules/tls/tls_init.c
+++ b/src/modules/tls/tls_init.c
@@ -627,13 +627,14 @@ int tls_h_mod_pre_init_f(void)
return 0;
}
LM_DBG("preparing tls env for modules initialization\n");
-#if OPENSSL_VERSION_NUMBER < 0x010100000L || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER >= 0x010100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ LM_DBG("preparing tls env for modules initialization (libssl >=1.1)\n");
+ OPENSSL_init_ssl(0, NULL);
+#else
LM_DBG("preparing tls env for modules initialization (libssl <=1.0)\n");
SSL_library_init();
- SSL_load_error_strings();
-#else
- LM_DBG("preparing tls env for modules initialization (libssl >=1.1)\n");
#endif
+ SSL_load_error_strings();
tls_mod_preinitialized=1;
return 0;
}
@@ -667,7 +668,7 @@ int tls_h_mod_init_f(void)
#if OPENSSL_VERSION_NUMBER < 0x00907000L
LM_WARN("You are using an old version of OpenSSL (< 0.9.7). Upgrade!\n");
#endif
- ssl_version=OpenSSL_version_num();
+ ssl_version=SSLeay();
/* check if version have the same major minor and fix level
* (e.g. 0.9.8a & 0.9.8c are ok, but 0.9.8 and 0.9.9x are not)
* - values is represented as 0xMMNNFFPPS: major minor fix patch status
@@ -679,7 +680,7 @@ int tls_h_mod_init_f(void)
" compiled \"%s\" (0x%08lx).\n"
" Please make sure a compatible version is used"
" (tls_force_run in kamailio.cfg will override this check)\n",
- OpenSSL_version(OPENSSL_VERSION), ssl_version,
+ SSLeay_version(SSLEAY_VERSION), ssl_version,
OPENSSL_VERSION_TEXT, (long)OPENSSL_VERSION_NUMBER);
if (cfg_get(tls, tls_cfg, force_run))
LM_WARN("tls_force_run turned on, ignoring "
@@ -856,7 +857,6 @@ int tls_check_sockets(tls_domains_cfg_t* cfg)
void tls_h_mod_destroy_f(void)
{
LM_DBG("tls module final tls destroy\n");
-#if OPENSSL_VERSION_NUMBER < 0x010100000L || defined(LIBRESSL_VERSION_NUMBER)
if(tls_mod_preinitialized > 0)
ERR_free_strings();
/* TODO: free all the ctx'es */
@@ -869,5 +869,4 @@ void tls_h_mod_destroy_f(void)
LM_DBG("executing openssl v1.1+ cleanup\n");
OPENSSL_cleanup();
#endif
-#endif
}
diff --git a/src/modules/tls/tls_locking.c b/src/modules/tls/tls_locking.c
index 3eb6f03..4e5bbcc 100644
--- a/src/modules/tls/tls_locking.c
+++ b/src/modules/tls/tls_locking.c
@@ -140,8 +140,6 @@ unsigned long sr_ssl_id_f()
/* returns -1 on error, 0 on success */
int tls_init_locks()
{
-/* OpenSSL is thread-safe since 1.1.0 */
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
/* init "static" tls locks */
n_static_locks=CRYPTO_num_locks();
if (n_static_locks<0){
@@ -169,10 +167,13 @@ int tls_init_locks()
CRYPTO_set_locking_callback(locking_f);
}
+/* OpenSSL is thread-safe since 1.1.0 */
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
/* set "dynamic" locks callbacks */
CRYPTO_set_dynlock_create_callback(dyn_create_f);
CRYPTO_set_dynlock_lock_callback(dyn_lock_f);
CRYPTO_set_dynlock_destroy_callback(dyn_destroy_f);
+#endif
/* starting with v1.0.0 openssl does not use anymore getpid(), but address
* of errno which can point to same virtual address in a multi-process
@@ -185,7 +186,6 @@ int tls_init_locks()
* (only atomic_inc), fallback to the default use-locks mode
* CRYPTO_set_add_lock_callback(atomic_add_f);
*/
-#endif
return 0;
error:

@ -1,42 +0,0 @@
From: Victor Seva <vseva@sipwise.com>
Date: Thu, 3 Dec 2020 14:32:45 +0100
Subject: cfgt: log info when node is created and saved
---
src/modules/cfgt/cfgt_int.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/modules/cfgt/cfgt_int.c b/src/modules/cfgt/cfgt_int.c
index c47a1ce..7b0c991 100644
--- a/src/modules/cfgt/cfgt_int.c
+++ b/src/modules/cfgt/cfgt_int.c
@@ -429,6 +429,8 @@ void cfgt_save_node(cfgt_node_p node)
}
fclose(fp);
node->jdoc.free_fn(dest.s);
+ LM_INFO("*** node uuid:[%.*s] id:[%d] saved ***\n",
+ STR_FMT(&node->uuid), node->msgid);
} else {
LM_ERR("Can't open file [%s] to write\n", dest.s);
pkg_free(dest.s);
@@ -767,7 +769,7 @@ int cfgt_msgin(sr_event_param_t *evp)
int cfgt_pre(struct sip_msg *msg, unsigned int flags, void *bar)
{
str unknown = {"unknown", 7};
- int get_hdr_result = 0;
+ int get_hdr_result = 0, res;
if(_cfgt_node) {
if(_cfgt_node->msgid == 0) {
@@ -786,7 +788,10 @@ int cfgt_pre(struct sip_msg *msg, unsigned int flags, void *bar)
}
pkg_str_dup(&_cfgt_node->uuid, &unknown);
}
- return _cfgt_get_uuid_id(_cfgt_node);
+ res = _cfgt_get_uuid_id(_cfgt_node);
+ LM_INFO("*** node uuid:[%.*s] id:[%d] created ***\n",
+ STR_FMT(&_cfgt_node->uuid), _cfgt_node->msgid);
+ return res;
} else {
LM_DBG("_cfgt_node->uuid:[%.*s]\n", _cfgt_node->uuid.len,
_cfgt_node->uuid.s);

@ -1,27 +0,0 @@
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Wed, 23 Sep 2020 09:01:43 +0200
Subject: [PATCH] ndb_redis: set message level to debug on exec
* logging error makes no sense here since there's going
to be a reconnection afterwards
> ERROR: ndb_redis [redis_client.c:903]: redisc_exec_argv(): Redis error: Server closed the connection
(cherry picked from commit a9c331d70dbed6827874aa99296203ac5a9d5c7b)
---
src/modules/ndb_redis/redis_client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/ndb_redis/redis_client.c b/src/modules/ndb_redis/redis_client.c
index 5ad063f..bd97012 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/src/modules/ndb_redis/redis_client.c
@@ -770,7 +770,7 @@ int redisc_exec_pipelined(redisc_server_t *rsrv)
/* null reply, reconnect and try again */
if (rsrv->ctxRedis->err)
{
- LM_ERR("Redis error: %s\n", rsrv->ctxRedis->errstr);
+ LM_DBG("Redis error: %s\n", rsrv->ctxRedis->errstr);
}
if (redisc_create_pipelined_message(rsrv) == 0)
{

@ -1,68 +0,0 @@
From: Victor Seva <vseva@sipwise.com>
Date: Fri, 4 Sep 2020 11:19:33 +0200
Subject: pv_headers: fix $x_hdr index on get
* previously we where not supporting pseudo-variables as index
---
src/modules/pv_headers/pvh_xavp.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/src/modules/pv_headers/pvh_xavp.c b/src/modules/pv_headers/pvh_xavp.c
index ad5ba9d..3e0fcc0 100644
--- a/src/modules/pv_headers/pvh_xavp.c
+++ b/src/modules/pv_headers/pvh_xavp.c
@@ -539,12 +539,12 @@ int pvh_get_header(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
sr_xavp_t *xavi = NULL;
sr_xval_t *xval = NULL;
pv_value_t tv;
- str hname = STR_NULL;
- int idx = 0;
+ str *hname = NULL;
+ int idx, idxf;
int cnt = 0;
- idx = param->pvi.u.ival;
-
+ /* if we use pv_get_spec_name() cfgt will throw errors trying to get values
+ like $x_hdr($xavp(whatever=>y)) when there's no $xavp(whatever=>y) */
if(param->pvn.type == PV_NAME_PVAR) {
if(pv_get_spec_value(msg, (pv_spec_p)(param->pvn.u.dname), &tv) != 0) {
LM_ERR("cannot get avp value\n");
@@ -553,24 +553,30 @@ int pvh_get_header(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
if(!(tv.flags & PV_VAL_STR)) {
return pv_get_null(msg, param, res);
}
- hname = tv.rs;
- } else if(param->pvn.u.isname.type == AVP_NAME_STR) {
- hname = param->pvn.u.isname.name.s;
+ hname = &tv.rs;
+ } else if(param->pvn.u.isname.type & AVP_NAME_STR) {
+ hname = &param->pvn.u.isname.name.s;
} else {
return pv_get_null(msg, param, res);
}
+ /* get the index */
+ if(pv_get_spec_index(msg, param, &idx, &idxf) != 0) {
+ LM_ERR("invalid index\n");
+ return -1;
+ }
+
if(idx < 0) {
- if((xavi = pvh_xavi_get_child(msg, &xavi_name, &hname)) == NULL)
+ if((xavi = pvh_xavi_get_child(msg, &xavi_name, hname)) == NULL)
cnt = 0;
else
- cnt = xavi_count(&hname, &xavi);
+ cnt = xavi_count(hname, &xavi);
idx = idx + cnt;
if(idx < 0)
- pv_get_null(msg, param, res);
+ return pv_get_null(msg, param, res);
}
- xval = pvh_xavi_get_value(msg, &xavi_name, &hname, idx);
+ xval = pvh_xavi_get_value(msg, &xavi_name, hname, idx);
if(xval == NULL || !xval->v.s.s)
return pv_get_null(msg, param, res);

@ -1,36 +0,0 @@
From b7cff8de3b3d26b1120678fac331ca52424e6c01 Mon Sep 17 00:00:00 2001
From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu, 7 Jan 2021 17:34:36 +0100
Subject: [PATCH] secsipid: Makefile - detect of pkg-config knows about
libsecsipid
(cherry picked from commit 664542adf42a4d829ddf9b9e482aba81f30883d8)
---
src/modules/secsipid/Makefile | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/modules/secsipid/Makefile b/src/modules/secsipid/Makefile
index 13012cd248..2b97061d31 100644
--- a/src/modules/secsipid/Makefile
+++ b/src/modules/secsipid/Makefile
@@ -7,7 +7,16 @@ include ../../Makefile.defs
auto_gen=
NAME=secsipid.so
-BUILDER = $(shell which pkg-config)
+ifeq ($(CROSS_COMPILE),)
+ BUILDER = $(shell which pkg-config)
+ifneq ($(BUILDER),)
+ PKGLIBSECSIPID = $(shell $(BUILDER) --exists secsipid-1 > /dev/null 2>&1 ; echo $$? )
+ifneq ($(PKGLIBSECSIPID),0)
+ BUILDER =
+endif
+endif
+endif
+
ifeq ($(BUILDER),)
DEFS+= -I.
LIBS = -L. -lsecsipid
--
2.20.1

@ -1,34 +0,0 @@
From 06bd17a8387008a3c7b797bd820a687ece5e3627 Mon Sep 17 00:00:00 2001
From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Fri, 8 Jan 2021 08:21:55 +0100
Subject: [PATCH] secsipid: include secsipid.h from standard path
(cherry picked from commit c1a3443b09cee8a923f8801f8f3034f078034bf5)
---
src/modules/secsipid/secsipid_mod.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/modules/secsipid/secsipid_mod.c b/src/modules/secsipid/secsipid_mod.c
index d3ad1c896e..efdb5ff50e 100644
--- a/src/modules/secsipid/secsipid_mod.c
+++ b/src/modules/secsipid/secsipid_mod.c
@@ -25,14 +25,14 @@
#include <stdlib.h>
#include <string.h>
+#include <secsipid.h>
+
#include "../../core/sr_module.h"
#include "../../core/dprint.h"
#include "../../core/mod_fix.h"
#include "../../core/data_lump.h"
#include "../../core/kemi.h"
-#include "secsipid.h"
-
MODULE_VERSION
static int secsipid_expire = 300;
--
2.20.1

@ -1,34 +0,0 @@
From b0a629ef9b366f4946dd1e73ce4aed2e028c119b Mon Sep 17 00:00:00 2001
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Thu, 7 Jan 2021 11:14:53 +0100
Subject: [PATCH] secsipid: use pkg-config when available
(cherry picked from commit 231a6eceeb67318cf4708a765b47df6c336350da)
---
src/modules/secsipid/Makefile | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/modules/secsipid/Makefile b/src/modules/secsipid/Makefile
index ec8ad07980..13012cd248 100644
--- a/src/modules/secsipid/Makefile
+++ b/src/modules/secsipid/Makefile
@@ -7,8 +7,14 @@ include ../../Makefile.defs
auto_gen=
NAME=secsipid.so
-DEFS+= -I.
-LIBS+= -L. -lsecsipid
+BUILDER = $(shell which pkg-config)
+ifeq ($(BUILDER),)
+ DEFS+= -I.
+ LIBS = -L. -lsecsipid
+else
+ DEFS+= $(shell pkg-config --cflags secsipid-1)
+ LIBS = $(shell pkg-config --libs secsipid-1)
+endif
ifeq ($(OS), darwin)
LIBS+= -framework CoreFoundation -framework Security -lpthread
--
2.20.1
Loading…
Cancel
Save