<p></p>
<p><b>@alexyosifov</b> approved this pull request.</p>

<p>Added some comments</p><hr>

<p>In <a href="https://github.com/kamailio/kamailio/pull/2731#discussion_r629295340">src/modules/ims_ipsec_pcscf/cmd.c</a>:</p>
<pre style='color:#555'>> @@ -846,11 +846,20 @@ int ipsec_forward(struct sip_msg* m, udomain_t* d, int _cflags)
         // for Reply get the dest proto from the received request
         dst_proto = req->rcv.proto;
 
-        // for Reply and TCP sends from P-CSCF server port, for Reply and UDP sends from P-CSCF client port
-        src_port = dst_proto == PROTO_TCP ? s->port_ps : s->port_pc;
+        // Check send socket
</pre>
<p>Why you have to check "send socket" here? You perform the check with zero src_port and dst_proto.<br>
The "send socket" always is present. If you scroll down at row 877 there is the same check and if "send socket" is not present the function returns an error.<br>
I do not see value from this change and I am not sure this will work properly.<br>
Correct me if I am wrong.</p>

<hr>

<p>In <a href="https://github.com/kamailio/kamailio/pull/2731#discussion_r629303144">src/modules/ims_ipsec_pcscf/ipsec.c</a>:</p>
<pre style='color:#555'>>      strcpy(l_enc_algo->alg_name,"cipher_null");
+    if (strncasecmp(r_ealg.s,"aes-cbc",r_ealg.len) == 0) {
</pre>
<p>Is it a good idea cipher algorithm to be optional? Just add a new value in _cflags parameter in int ipsec_create(struct sip_msg* m, udomain_t* d, int _cflags) method.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/2731#pullrequestreview-655554158">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZOQFI6TQM4PGGA7ABTTM7EXLANCNFSM44PQXWGQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZKLKKCVQZYUX5CWJI3TM7EXLA5CNFSM44PQXWG2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOE4JPM3Q.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/pull/2731#pullrequestreview-655554158",
"url": "https://github.com/kamailio/kamailio/pull/2731#pullrequestreview-655554158",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>