MT#56144 refresh patches and remove already applied upstream

Change-Id: Ie7b9f1bd6ba89b3d696b04011854760fbfb71407
mr9.5.7
Victor Seva 4 years ago
parent 64d31156fa
commit d5a53e8e0e

@ -7,7 +7,7 @@ Subject: no_lib64_on_64_bits
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/src/Makefile.defs b/src/Makefile.defs
index 5fdc880..4833e85 100644
index 0e49c6f..4060de2 100644
--- a/src/Makefile.defs
+++ b/src/Makefile.defs
@@ -454,15 +454,7 @@ endif

@ -39,9 +39,6 @@ sipwise/Revert-pua_dialoginfo-disable-publish-notifications-.patch
## upstream master
upstream/permissions-don-t-remove-old-data-at-the-end-of-the-.patch
upstream/permissions-trusted_cleanup_interval.patch
upstream/topos_use_direction_for_loading_invite_record_for_other_early_dialog_requests.patch
upstream/topos_restore_attributes_based_on_direction_for_early_dialog_requests.patch
upstream/topos_redis_use_tag_based_on_direction_for_early_dialog_transaction_record_loading.patch
### relevant for upstream
sipwise/pua_dialoginfo-refresh_pubruri_avps_flag.patch
sipwise/pua_dialoginfo-local_identity_dlg_var.patch
@ -59,14 +56,12 @@ sipwise/db_redis_skip_empty_keys.patch
sipwise/db_redis_graceful_scan.patch
sipwise/db_redis_sscan.patch
sipwise/db_redis_sscan_fix_empty_key.patch
sipwise/db_redis-clean-previous-connection-before-trying-to-.patch
sipwise/kamctl-TMPDIR-config.patch
sipwise/pv_headers-fix-build-warning.patch
sipwise/pv_headers-use-memset.patch
sipwise/pv_headers-rework-pvh_remove_header_param.patch
### active development
sipwise/lcr-stopper_mode-parameter.patch
sipwise/tm-check-again-T-just-in-case-before-UNREF.patch
sipwise/presence-be-more-resilient-doing-clean-up.patch
upstream/tm-new-inter-module-API-function-t_find.patch
upstream/pv_headers-use-tm.t_find-API.patch

@ -1,24 +0,0 @@
From: Victor Seva <vseva@sipwise.com>
Date: Mon, 28 Feb 2022 15:24:21 +0100
Subject: db_redis: clean previous connection before trying to reconnect
---
src/modules/db_redis/redis_connection.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/modules/db_redis/redis_connection.c b/src/modules/db_redis/redis_connection.c
index dd421a7..d6c2416 100644
--- a/src/modules/db_redis/redis_connection.c
+++ b/src/modules/db_redis/redis_connection.c
@@ -112,6 +112,11 @@ int db_redis_connect(km_redis_con_t *con) {
db = atoi(con->id->database);
reply = NULL;
+ if(con->con) {
+ LM_DBG("free old connection first\n");
+ redisFree(con->con);
+ }
+
// TODO: introduce require_master mod-param and check if we're indeed master
// TODO: on carrier, if we have db fail-over, the currently connected
// redis server will become slave without dropping connections?

@ -7,7 +7,7 @@ Subject: db_redis_graceful_scan
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index 68d8412..c82f82b 100644
index b121de6..5b1d6b1 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -754,7 +754,7 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, const str *matc

@ -7,7 +7,7 @@ Subject: db_redis_skip_empty_keys
1 file changed, 3 insertions(+)
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index ac1bd2b..68d8412 100644
index 78a7466..b121de6 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -641,6 +641,9 @@ static int db_redis_build_query_keys(km_redis_con_t *con, const str *table_name,

@ -7,7 +7,7 @@ Subject: db_redis_sscan
1 file changed, 65 insertions(+), 21 deletions(-)
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index c82f82b..dd11ad5 100644
index 5b1d6b1..68e3456 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -591,7 +591,7 @@ err:

@ -7,7 +7,7 @@ Subject: db_redis_sscan_fix_empty_key
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index dd11ad5..ffe6ad7 100644
index 68e3456..5502fb7 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -784,7 +784,7 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, const str *matc

@ -10,7 +10,7 @@ but will sort them first before stopping
2 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/src/modules/lcr/lcr_mod.c b/src/modules/lcr/lcr_mod.c
index d24f952..0bf6827 100644
index 29925cd..90d789f 100644
--- a/src/modules/lcr/lcr_mod.c
+++ b/src/modules/lcr/lcr_mod.c
@@ -205,6 +205,10 @@ static unsigned int priority_ordering_param = 0;

@ -7,7 +7,7 @@ Subject: pv_headers: fix t_resume scenario
1 file changed, 49 insertions(+)
diff --git a/src/modules/pv_headers/pv_headers.c b/src/modules/pv_headers/pv_headers.c
index fd9a619..5afe2dc 100644
index 57be587..8c7539d 100644
--- a/src/modules/pv_headers/pv_headers.c
+++ b/src/modules/pv_headers/pv_headers.c
@@ -65,6 +65,7 @@ static void mod_destroy(void);

@ -12,7 +12,7 @@ Subject: pv_headers: rework pvh_remove_header_param, take two
4 files changed, 38 insertions(+), 28 deletions(-)
diff --git a/src/modules/pv_headers/pv_headers.c b/src/modules/pv_headers/pv_headers.c
index 7da426c..a41658e 100644
index 8a2976e..57be587 100644
--- a/src/modules/pv_headers/pv_headers.c
+++ b/src/modules/pv_headers/pv_headers.c
@@ -222,12 +222,15 @@ static int w_pvh_header_param_exists(

@ -1,21 +0,0 @@
From: Victor Seva <vseva@sipwise.com>
Date: Mon, 4 Jul 2022 15:49:20 +0200
Subject: tm: check T just in case before UNREF
---
src/modules/tm/t_funcs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/tm/t_funcs.h b/src/modules/tm/t_funcs.h
index 6830b13..dbbdc19 100644
--- a/src/modules/tm/t_funcs.h
+++ b/src/modules/tm/t_funcs.h
@@ -110,7 +110,7 @@ int send_pr_buffer( struct retr_buf *rb, void *buf, int len);
#define UNREF_NOSTATS(_T_cell) \
do{\
- if (atomic_dec_and_test(&(_T_cell)->ref_count)){ \
+ if (_T_cell && atomic_dec_and_test(&(_T_cell)->ref_count)){ \
unlink_timers((_T_cell)); \
free_cell((_T_cell)); \
}\

@ -8,10 +8,10 @@ unless original msg has contact
1 file changed, 5 insertions(+)
diff --git a/src/modules/topos/tps_msg.c b/src/modules/topos/tps_msg.c
index 854d2cd..09bd43d 100644
index 83d5f5f..6e9393e 100644
--- a/src/modules/topos/tps_msg.c
+++ b/src/modules/topos/tps_msg.c
@@ -1160,6 +1160,11 @@ int tps_response_sent(sip_msg_t *msg)
@@ -1161,6 +1161,11 @@ int tps_response_sent(sip_msg_t *msg)
&& msg->contact==NULL) {
contact_keep = 1;
}

@ -10,7 +10,7 @@ cleanup old data of trusted hash_table by timer function.
3 files changed, 23 insertions(+)
diff --git a/src/modules/permissions/permissions.c b/src/modules/permissions/permissions.c
index 12ab2d8..d565520 100644
index 231117c..6f1b36c 100644
--- a/src/modules/permissions/permissions.c
+++ b/src/modules/permissions/permissions.c
@@ -61,6 +61,7 @@ static char* perm_deny_suffix = ".deny";

@ -1,4 +1,3 @@
From 72234f9efbb5b299823b33dc4eda84a43d5f6384 Mon Sep 17 00:00:00 2001
From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue, 30 Aug 2022 10:58:39 +0200
Subject: [PATCH] pv_headers: use t_unset() based on vref instead of resetting
@ -9,7 +8,7 @@ Subject: [PATCH] pv_headers: use t_unset() based on vref instead of resetting
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/modules/pv_headers/pv_headers.c b/src/modules/pv_headers/pv_headers.c
index 7da426c184..b900ae5be6 100644
index f547f2d..8a2976e 100644
--- a/src/modules/pv_headers/pv_headers.c
+++ b/src/modules/pv_headers/pv_headers.c
@@ -555,12 +555,12 @@ int handle_msg_reply_cb(struct sip_msg *msg, unsigned int flags, void *cb)
@ -29,6 +28,3 @@ index 7da426c184..b900ae5be6 100644
return 1;
}
--
2.30.2

@ -1,4 +1,3 @@
From 836d122af8575c66651232f3ad25bad085bfb972 Mon Sep 17 00:00:00 2001
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Sun, 28 Aug 2022 22:59:44 +0200
Subject: [PATCH] pv_headers: use tm.t_find API
@ -8,7 +7,7 @@ Subject: [PATCH] pv_headers: use tm.t_find API
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/src/modules/pv_headers/pv_headers.c b/src/modules/pv_headers/pv_headers.c
index e555e0265b..7da426c184 100644
index 9658ed7..f547f2d 100644
--- a/src/modules/pv_headers/pv_headers.c
+++ b/src/modules/pv_headers/pv_headers.c
@@ -526,6 +526,7 @@ int handle_msg_branch_cb(struct sip_msg *msg, unsigned int flags, void *cb)
@ -53,6 +52,3 @@ index e555e0265b..7da426c184 100644
tmb.unref_cell(t);
LM_DBG("T:%p unref\n", t);
}
--
2.30.2

@ -1,4 +1,3 @@
From f69c13a587df53fb93999d81cd02dc99ab223187 Mon Sep 17 00:00:00 2001
From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue, 30 Aug 2022 10:53:15 +0200
Subject: [PATCH] tm: added t_unset() intermodule API function
@ -14,7 +13,7 @@ Subject: [PATCH] tm: added t_unset() intermodule API function
4 files changed, 18 insertions(+)
diff --git a/src/modules/tm/t_lookup.c b/src/modules/tm/t_lookup.c
index ad41f0de93..dd2ed6f0ae 100644
index 9b21e98..8618894 100644
--- a/src/modules/tm/t_lookup.c
+++ b/src/modules/tm/t_lookup.c
@@ -167,6 +167,19 @@ struct cell* t_find(struct sip_msg *msg, int *branch, int *vref)
@ -38,7 +37,7 @@ index ad41f0de93..dd2ed6f0ae 100644
{
if (parse_headers(msg, HDR_FROM_F | HDR_CSEQ_F | HDR_TO_F, 0)==-1) {
diff --git a/src/modules/tm/t_lookup.h b/src/modules/tm/t_lookup.h
index de65be8365..c4b5404cf8 100644
index de65be8..c4b5404 100644
--- a/src/modules/tm/t_lookup.h
+++ b/src/modules/tm/t_lookup.h
@@ -71,6 +71,9 @@ struct cell *get_t(void);
@ -52,7 +51,7 @@ index de65be8365..c4b5404cf8 100644
int get_t_branch(void);
diff --git a/src/modules/tm/tm_load.c b/src/modules/tm/tm_load.c
index c9f39b576e..d5fc6e7884 100644
index 0687703..b2f5364 100644
--- a/src/modules/tm/tm_load.c
+++ b/src/modules/tm/tm_load.c
@@ -93,6 +93,7 @@ int load_tm( struct tm_binds *tmb)
@ -64,7 +63,7 @@ index c9f39b576e..d5fc6e7884 100644
tmb->t_sett = set_t;
tmb->calculate_hooks = w_calculate_hooks;
diff --git a/src/modules/tm/tm_load.h b/src/modules/tm/tm_load.h
index 1f97061d1e..130d01503a 100644
index d1d44f7..018869e 100644
--- a/src/modules/tm/tm_load.h
+++ b/src/modules/tm/tm_load.h
@@ -72,6 +72,7 @@ struct tm_binds {
@ -75,6 +74,3 @@ index 1f97061d1e..130d01503a 100644
tgett_branch_f t_gett_branch;
tsett_f t_sett;
calculate_hooks_f calculate_hooks;
--
2.30.2

@ -1,4 +1,3 @@
From a9cf4577c25d7933531b8969a1941bac4faf8d68 Mon Sep 17 00:00:00 2001
From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu, 25 Aug 2022 14:51:23 +0200
Subject: [PATCH] tm: new inter-module API function t_find(...)
@ -13,7 +12,7 @@ Subject: [PATCH] tm: new inter-module API function t_find(...)
4 files changed, 27 insertions(+)
diff --git a/src/modules/tm/t_lookup.c b/src/modules/tm/t_lookup.c
index f041116bb8..ad41f0de93 100644
index 4ccdee7..9b21e98 100644
--- a/src/modules/tm/t_lookup.c
+++ b/src/modules/tm/t_lookup.c
@@ -145,6 +145,28 @@ int get_t_branch()
@ -46,7 +45,7 @@ index f041116bb8..ad41f0de93 100644
{
if (parse_headers(msg, HDR_FROM_F | HDR_CSEQ_F | HDR_TO_F, 0)==-1) {
diff --git a/src/modules/tm/t_lookup.h b/src/modules/tm/t_lookup.h
index 1f6596a90d..de65be8365 100644
index 1f6596a..de65be8 100644
--- a/src/modules/tm/t_lookup.h
+++ b/src/modules/tm/t_lookup.h
@@ -68,6 +68,9 @@ int t_check_msg(struct sip_msg* , int *branch );
@ -60,7 +59,7 @@ index 1f6596a90d..de65be8365 100644
int get_t_branch(void);
diff --git a/src/modules/tm/tm_load.c b/src/modules/tm/tm_load.c
index 8635b90eae..c9f39b576e 100644
index 0afa4d3..0687703 100644
--- a/src/modules/tm/tm_load.c
+++ b/src/modules/tm/tm_load.c
@@ -92,6 +92,7 @@ int load_tm( struct tm_binds *tmb)
@ -72,7 +71,7 @@ index 8635b90eae..c9f39b576e 100644
tmb->t_sett = set_t;
tmb->calculate_hooks = w_calculate_hooks;
diff --git a/src/modules/tm/tm_load.h b/src/modules/tm/tm_load.h
index 4695a8f7e1..1f97061d1e 100644
index a84dc75..d1d44f7 100644
--- a/src/modules/tm/tm_load.h
+++ b/src/modules/tm/tm_load.h
@@ -71,6 +71,7 @@ struct tm_binds {
@ -83,6 +82,3 @@ index 4695a8f7e1..1f97061d1e 100644
tgett_branch_f t_gett_branch;
tsett_f t_sett;
calculate_hooks_f calculate_hooks;
--
2.30.2

@ -1,43 +0,0 @@
--- a/src/modules/topos_redis/topos_redis_storage.c
+++ b/src/modules/topos_redis/topos_redis_storage.c
@@ -54,6 +54,10 @@ static str _tps_redis_dprefix = str_init
static char _tps_redis_cbuf[TPS_REDIS_DATA_SIZE];
+static str _tps_redis_empty = str_init("");
+
+#define TPS_REDIS_STRZ(_s) ((_s).s)?(_s):(_tps_redis_empty)
+
/**
* storage keys
*/
@@ -594,6 +598,7 @@ int tps_redis_load_initial_method_branch
str skey = STR_NULL;
str sval = STR_NULL;
str xuuid = str_init("");
+ str xtag = str_init("");
str smethod = str_init("INVITE");
if(msg==NULL || md==NULL || sd==NULL)
@@ -615,6 +620,12 @@ int tps_redis_load_initial_method_branch
memset(argvlen, 0, TPS_REDIS_NR_KEYS * sizeof(size_t));
argc = 0;
+ if(md->direction==TPS_DIR_DOWNSTREAM) {
+ xtag = TPS_REDIS_STRZ(md->b_tag);
+ } else {
+ xtag = TPS_REDIS_STRZ(md->a_tag);
+ }
+
if(md->a_uuid.len>1) {
xuuid.s = md->a_uuid.s + 1;
xuuid.len = md->a_uuid.len - 1;
@@ -641,7 +652,7 @@ int tps_redis_load_initial_method_branch
_tps_redis_bprefix.len, _tps_redis_bprefix.s,
smethod.len, smethod.s,
md->a_callid.len, md->a_callid.s,
- md->b_tag.len, md->b_tag.s,
+ xtag.len, xtag.s,
xuuid.len, xuuid.s);
if(rkey.len<0 || rkey.len>=TPS_REDIS_DATA_SIZE) {
LM_ERR("error or insufficient buffer size: %d\n", rkey.len);

@ -1,20 +0,0 @@
--- a/src/modules/topos/tps_msg.c
+++ b/src/modules/topos/tps_msg.c
@@ -866,7 +866,7 @@ int tps_request_received(sip_msg_t *msg,
tps_storage_lock_release(&lkey);
- if(use_branch) {
+ if(use_branch && direction == TPS_DIR_DOWNSTREAM) {
nuri = stsd.b_contact;
} else {
if(direction == TPS_DIR_UPSTREAM) {
@@ -884,7 +884,7 @@ int tps_request_received(sip_msg_t *msg,
}
}
- if(use_branch) {
+ if(use_branch && direction == TPS_DIR_DOWNSTREAM) {
if(tps_reappend_route(msg, &stsd, &stsd.s_rr, 1) < 0) {
LM_ERR("failed to reappend s-route\n");
return -1;

@ -1,49 +0,0 @@
--- a/src/modules/topos/tps_msg.c
+++ b/src/modules/topos/tps_msg.c
@@ -803,6 +803,7 @@ int tps_request_received(sip_msg_t *msg,
uint32_t direction = TPS_DIR_DOWNSTREAM;
int ret;
int use_branch = 0;
+ unsigned int metid = 0;
LM_DBG("handling incoming request\n");
@@ -835,10 +836,11 @@ int tps_request_received(sip_msg_t *msg,
if(tps_storage_load_dialog(msg, &mtsd, &stsd) < 0) {
goto error;
}
- if(((get_cseq(msg)->method_id) & (METHOD_BYE|METHOD_PRACK|METHOD_UPDATE))
- && stsd.b_contact.len <= 0) {
+ metid = get_cseq(msg)->method_id;
+ if((metid & (METHOD_BYE|METHOD_PRACK|METHOD_UPDATE))
+ && stsd.b_contact.len <= 0) {
/* no B-side contact, look for INVITE transaction record */
- if((get_cseq(msg)->method_id) & (METHOD_UPDATE)) {
+ if(metid & (METHOD_BYE|METHOD_UPDATE)) {
/* detect direction - via from-tag */
if(tps_dlg_detect_direction(msg, &stsd, &direction) < 0) {
goto error;
@@ -916,7 +918,7 @@ int tps_request_received(sip_msg_t *msg,
goto error;
}
}
- if((get_cseq(msg)->method_id)&(METHOD_SUBSCRIBE)) {
+ if(metid & METHOD_SUBSCRIBE) {
if(tps_storage_update_dialog(msg, &mtsd, &stsd, TPS_DBU_CONTACT|TPS_DBU_TIME)<0) {
goto error;
}
--- a/src/modules/topos/tps_storage.c
+++ b/src/modules/topos/tps_storage.c
@@ -1135,7 +1135,11 @@ int tps_db_load_branch(sip_msg_t *msg, t
db_ops[nr_keys]=OP_EQ;
db_vals[nr_keys].type = DB1_STR;
db_vals[nr_keys].nul = 0;
- db_vals[nr_keys].val.str_val = TPS_STRZ(md->b_tag);
+ if(md->direction==TPS_DIR_DOWNSTREAM) {
+ db_vals[nr_keys].val.str_val = TPS_STRZ(md->b_tag);
+ } else {
+ db_vals[nr_keys].val.str_val = TPS_STRZ(md->a_tag);
+ }
nr_keys++;
db_keys[nr_keys]=&tt_col_s_method;
Loading…
Cancel
Save