<p></p>
<p><b>@alexyosifov</b> requested changes on this pull request.</p>

<p dir="auto">Just a small note:<br>
Change: LM_ERR("Error using old IPSEC tunnel creation\n");<br>
To: LM_DBG("Reusing old IPSEC tunnel creation\n");</p><hr>

<p>In <a href="https://github.com/kamailio/kamailio/pull/3094#discussion_r863671090">src/modules/ims_ipsec_pcscf/cmd.c</a>:</p>
<pre style='color:#555'>> @@ -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");
</pre>
<p dir="auto">Change log message to debug or info.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/3094#pullrequestreview-960212148">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZMFSH427BFQLRRNBSDVJY5ELANCNFSM5UPAWEYA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ABO7UZLO6WVZEFC2M4MEYE3VJY5ELA5CNFSM5UPAWEYKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOHE52ZNA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><kamailio/kamailio/pull/3094/review/960212148</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/pull/3094#pullrequestreview-960212148",
"url": "https://github.com/kamailio/kamailio/pull/3094#pullrequestreview-960212148",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>