Module: kamailio
Branch: 5.8
Commit: c73ea949c046697916fd86eaf614b59075264b73
URL:
https://github.com/kamailio/kamailio/commit/c73ea949c046697916fd86eaf614b59…
Author: herlesupreeth <herlesupreeth(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-06-19T10:58:04+02:00
ims_ipsec_pcscf: update security params of newly created ipsec tunnel in contact
(cherry picked from commit bf863877f666dd8350e855bf933270b2fd8ad0fd)
---
Modified: src/modules/ims_ipsec_pcscf/cmd.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c73ea949c046697916fd86eaf614b59…
Patch:
https://github.com/kamailio/kamailio/commit/c73ea949c046697916fd86eaf614b59…
---
diff --git a/src/modules/ims_ipsec_pcscf/cmd.c b/src/modules/ims_ipsec_pcscf/cmd.c
index 05079834252..3ce36d27952 100644
--- a/src/modules/ims_ipsec_pcscf/cmd.c
+++ b/src/modules/ims_ipsec_pcscf/cmd.c
@@ -900,12 +900,10 @@ int ipsec_create(struct sip_msg *m, udomain_t *d, int _cflags)
goto cleanup;
}
- if(ul.update_pcontact(d, &ci, pcontact) != 0) {
- LM_ERR("Error updating contact\n");
- goto cleanup;
- }
-
if(ci.via_port == SIP_PORT) {
+ if(req_sec_params != NULL) {
+ pcontact->security_temp->data.ipsec = s;
+ }
// Update temp security parameters
if(ul.update_temp_security(d, pcontact->security_temp->type,
pcontact->security_temp, pcontact)
@@ -914,6 +912,10 @@ int ipsec_create(struct sip_msg *m, udomain_t *d, int _cflags)
}
}
+ if(ul.update_pcontact(d, &ci, pcontact) != 0) {
+ LM_ERR("Error updating contact\n");
+ goto cleanup;
+ }
if(add_supported_secagree_header(m) != 0) {
goto cleanup;