<!-- Kamailio Pull Request Template -->
<!-- IMPORTANT: - for detailed contributing guidelines, read: https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md - pull requests must be done to master branch, unless they are backports of fixes from master branch to a stable branch - backports to stable branches must be done with 'git cherry-pick -x ...' - code is contributed under BSD for core and main components (tm, sl, auth, tls) - code is contributed GPLv2 or a compatible license for the other components - GPL code is contributed with OpenSSL licensing exception -->
#### Pre-Submission Checklist <!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply --> <!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above--> <!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list --> - [X] Commit message has the format required by CONTRIBUTING guide - [X] Commits are split per component (core, individual modules, libs, utils, ...) - [X] Each component has a single commit (if not, squash them into one commit) - [X] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change - [ ] Small bug fix (non-breaking change which fixes an issue) - [X] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist: <!-- Go over all points below, and after creating the PR, tick the checkboxes that apply --> - [ ] PR should be backported to stable branches - [X] Tested changes locally - [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description <!-- Describe your changes in detail --> Implement reuse of IPSec tunnels when UEs are re-registering or de-registering, optimizing tunnel creations and key exchanges, and (hopefully) performance. This is a refactored version of PR #3029. I hope that all the issues @alexyosifov found have been fixed. You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3094
-- Commit Summary --
* ims_ipsec_pcscf: fix issues with UEs and ipsec tunnel
-- File Changes --
M src/modules/ims_ipsec_pcscf/cmd.c (151) M src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c (12) M src/modules/ims_ipsec_pcscf/ipsec.c (29) D src/modules/ims_ipsec_pcscf/port_gen.c (227) D src/modules/ims_ipsec_pcscf/port_gen.h (41) M src/modules/ims_ipsec_pcscf/sec_agree.c (33) M src/modules/ims_ipsec_pcscf/spi_gen.c (112) M src/modules/ims_ipsec_pcscf/spi_gen.h (6) M src/modules/ims_ipsec_pcscf/spi_list.c (62) M src/modules/ims_ipsec_pcscf/spi_list.h (12)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3094.patch https://github.com/kamailio/kamailio/pull/3094.diff
@kristiyan-peychev-flolive, 10x for the changes! I will check them asap.
@kristiyan-peychev-flolive pushed 1 commit.
ec7c253277e3db2a853ce9530ed7c670e21e55ff ims_ipsec_pcscf: fix issues pointed out in code review
@alexyosifov requested changes on this pull request.
Just a small note: Change: LM_ERR("Error using old IPSEC tunnel creation\n"); To: LM_DBG("Reusing old IPSEC tunnel creation\n");
@@ -352,57 +351,26 @@ static int update_contact_ipsec_params(ipsec_t* s, const struct sip_msg* m, ipse
s->ik.len = ik.len;
// Generate SPI - if((s->spi_pc = acquire_spi()) == 0) { - LM_ERR("Error generating client SPI for IPSEC tunnel creation\n"); - shm_free(s->ck.s); - s->ck.s = NULL; s->ck.len = 0; - shm_free(s->ik.s); - s->ik.s = NULL; s->ik.len = 0; - return -1; + if(s_old) { + if(s_old->spi_pc && s_old->spi_ps && s_old->port_pc && s_old->port_ps) { + LM_ERR("Error using old IPSEC tunnel creation\n");
Change log message to debug or info.
@kristiyan-peychev-flolive pushed 1 commit.
78cea07e7858616942981eab4a0238796689fe9c ims_ipsec_pcscf: lower log severity from error to info
Looks OK to me! All recommendations were fixed.
Merged #3094 into master.