Module: kamailio Branch: 6.0 Commit: f8df3ff98392c63733e0eb7e2c47e502730ee9dc URL: https://github.com/kamailio/kamailio/commit/f8df3ff98392c63733e0eb7e2c47e502730ee9dc
Author: herlesupreeth <[email protected]> Committer: Victor Seva <[email protected]> Date: 2026-01-26T18:31:08+01:00 ims_ipsec_pcscf: reuse IPSec tunnel params only if Ck and Ik stays the same (cherry picked from commit e728b7b8ec58cbd4c322fac076ef24572e895d0a) --- Modified: src/modules/ims_ipsec_pcscf/cmd.c --- Diff: https://github.com/kamailio/kamailio/commit/f8df3ff98392c63733e0eb7e2c47e502730ee9dc.diff Patch: https://github.com/kamailio/kamailio/commit/f8df3ff98392c63733e0eb7e2c47e502730ee9dc.patch --- diff --git a/src/modules/ims_ipsec_pcscf/cmd.c b/src/modules/ims_ipsec_pcscf/cmd.c index 8871a76c6b4..ccd5a7f1d00 100644 --- a/src/modules/ims_ipsec_pcscf/cmd.c +++ b/src/modules/ims_ipsec_pcscf/cmd.c @@ -461,8 +461,10 @@ static int update_contact_ipsec_params( memcpy(s->ik.s, ik.s, ik.len); s->ik.len = ik.len; - // Generate SPI - if(s_old) { + // Reuse only if both CK and IK match. + if(s_old && s_old->ck.s != NULL && s_old->ik.s != NULL + && strcmp(s_old->ck.s, s->ck.s) == 0 + && strcmp(s_old->ik.s, s->ik.s) == 0) { if(s_old->spi_pc && s_old->spi_ps && s_old->port_pc && s_old->port_ps) { LM_INFO("Reusing IPSEC tunnel\n"); s->spi_pc = s_old->spi_pc; _______________________________________________ Kamailio - Development Mailing List -- [email protected] To unsubscribe send an email to [email protected] Important: keep the mailing list in the recipients, do not reply only to the sender!
