From 75de09f369abad7192c853e74c99741feadec619 Mon Sep 17 00:00:00 2001 From: herlesupreeth Date: Sun, 24 Dec 2023 13:46:07 +0100 Subject: [PATCH] ims_ipsec_pcscf: reset destination URI after value is used to decide destination protocol to use --- src/modules/ims_ipsec_pcscf/cmd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/modules/ims_ipsec_pcscf/cmd.c b/src/modules/ims_ipsec_pcscf/cmd.c index de61ad7cf6b..47f9e401702 100644 --- a/src/modules/ims_ipsec_pcscf/cmd.c +++ b/src/modules/ims_ipsec_pcscf/cmd.c @@ -1016,13 +1016,6 @@ int ipsec_forward(struct sip_msg *m, udomain_t *d, int _cflags) // from URI //int uri_len = 4 /* strlen("sip:") */ + ci.via_host.len + 5 /* max len of port number */ ; - if(!(_cflags & IPSEC_NODSTURI_RESET) && (m->dst_uri.s != NULL)) { - LM_DBG("resetting dst uri [%.*s]\n", m->dst_uri.len, m->dst_uri.s); - pkg_free(m->dst_uri.s); - m->dst_uri.s = NULL; - m->dst_uri.len = 0; - } - if(_cflags & IPSEC_FORWARD_USEVIA) { vb = cscf_get_last_via(m); } @@ -1119,6 +1112,13 @@ int ipsec_forward(struct sip_msg *m, udomain_t *d, int _cflags) } } + if(!(_cflags & IPSEC_NODSTURI_RESET) && (m->dst_uri.s != NULL)) { + LM_DBG("resetting dst uri [%.*s]\n", m->dst_uri.len, m->dst_uri.s); + pkg_free(m->dst_uri.s); + m->dst_uri.s = NULL; + m->dst_uri.len = 0; + } + if(!(_cflags & IPSEC_NODSTURI_RESET)) { char buf[1024]; int buf_len;