diff --git a/debian/patches/series b/debian/patches/series index 52c97d0f6..b04b136d4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -80,6 +80,7 @@ upstream/tm-use-q-field-comparison-in-while-for-standard-t-co.patch # upstream master (5.5) upstream/ndb_redis-set-message-level-to-debug-on-reconnect.patch upstream/pv_headers-fix-removal-of-all-values-on-when-using-P.patch +upstream/pv_headers-pvh_set_header-remove-values-to-set-null-.patch ### relevant for upstream # sipwise/pua_dialoginfo-refresh_pubruri_avps_flag.patch diff --git a/debian/patches/upstream/pv_headers-pvh_set_header-remove-values-to-set-null-.patch b/debian/patches/upstream/pv_headers-pvh_set_header-remove-values-to-set-null-.patch new file mode 100644 index 000000000..89404879a --- /dev/null +++ b/debian/patches/upstream/pv_headers-pvh_set_header-remove-values-to-set-null-.patch @@ -0,0 +1,39 @@ +From: Victor Seva +Date: Tue, 27 Jul 2021 13:13:36 +0200 +Subject: [PATCH] pv_headers: pvh_set_header, remove values to set null when + necessary + +* fix pvh_set_xavi for SR_XTYPE_NULL + +--- + src/modules/pv_headers/pvh_xavp.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/src/modules/pv_headers/pvh_xavp.c b/src/modules/pv_headers/pvh_xavp.c +index ae773e5..17cfdd1 100644 +--- a/src/modules/pv_headers/pvh_xavp.c ++++ b/src/modules/pv_headers/pvh_xavp.c +@@ -374,7 +374,7 @@ int pvh_set_xavi(struct sip_msg *msg, str *xname, str *name, void *data, + LM_DBG("br_xname: %.*s name: %.*s append:%d\n", + br_xname.len, br_xname.s, name->len, name->s, append); + memset(&xval, 0, sizeof(sr_xval_t)); +- if(data == NULL || SR_XTYPE_NULL) { ++ if(data == NULL || type == SR_XTYPE_NULL) { + xval.type = SR_XTYPE_NULL; + } else if(type == SR_XTYPE_STR) { + xval.type = SR_XTYPE_STR; +@@ -630,9 +630,11 @@ int pvh_set_header( + + if(val == NULL || (val->flags & PV_VAL_NULL)) { + if(idxf == PV_IDX_ALL) { +- cnt = xavi_rm_by_name(hname, 1, &avi); +- LM_DBG("removed %d values of %.*s=>%.*s, set $null\n", +- cnt, xavi->name.len, xavi->name.s, hname->len, hname->s); ++ if(hname_cnt > 1) { ++ cnt = xavi_rm_by_name(hname, 1, &avi); ++ LM_DBG("removed %d values of %.*s=>%.*s, set $null\n", ++ cnt, xavi->name.len, xavi->name.s, hname->len, hname->s); ++ } + if(pvh_set_xavi(msg, &xavi_name, hname, NULL, SR_XTYPE_NULL, 0, 0) + < 0) + goto err;