<div dir="ltr">Hi,<div><br></div><div>thanks a lot for the quick response! Tested the fix and it seems to work. For example here without fix it would have "halted":</div><div><br></div><div>2020-10-29T12:14:10.103814+00:00 test-server charon: 04[ENC] generating IKE_AUTH response 7 [ EAP/REQ/TLS ]<br>2020-10-29T12:14:10.104212+00:00 test-server charon: 04[NET] sending packet: from <anonymized server ip>[4500] to <anonymized client ip>[4500] (67 bytes)<br>2020-10-29T12:14:10.104608+00:00 test-server charon: 12[NET] received packet: from <anonymized client ip>[4500] to <anonymized server ip>[4500] (540 bytes)<br>2020-10-29T12:14:10.105021+00:00 test-server charon: 12[ENC] parsed IKE_AUTH request 7 [ EF(2/3) ]<br>2020-10-29T12:14:10.105418+00:00 test-server charon: 12[ENC] received fragment #2 of 3, waiting for complete IKE message<br>2020-10-29T12:14:10.105814+00:00 test-server charon: 11[NET] received packet: from <anonymized client ip>[4500] to <anonymized server ip>[4500] (140 bytes)<br>2020-10-29T12:14:10.106216+00:00 test-server charon: 11[ENC] parsed IKE_AUTH request 7 [ EF(3/3) ]<br>2020-10-29T12:14:10.106738+00:00 test-server charon: 11[ENC] received fragment #3 of 3, waiting for complete IKE message<br>2020-10-29T12:14:11.131206+00:00 test-server charon: 10[NET] received packet: from <anonymized client ip>[4500] to <anonymized server ip>[4500] (540 bytes)<br>2020-10-29T12:14:11.131851+00:00 test-server charon: 10[ENC] parsed IKE_AUTH request 8 [ EF(1/2) ]<br>2020-10-29T12:14:11.132280+00:00 test-server charon: 10[ENC] received fragment #1 of 2, waiting for complete IKE message<br>2020-10-29T12:14:11.859189+00:00 test-server charon: 03[KNL] querying SAD entry with SPI c70fd0c1<br>2020-10-29T12:14:11.859766+00:00 test-server charon: 03[KNL] querying policy <a href="http://198.18.64.2/32">198.18.64.2/32</a> === <a href="http://0.0.0.0/0">0.0.0.0/0</a> in<br>2020-10-29T12:14:11.860201+00:00 test-server charon: 03[KNL] querying policy <a href="http://198.18.64.2/32">198.18.64.2/32</a> === <a href="http://0.0.0.0/0">0.0.0.0/0</a> fwd<br>2020-10-29T12:14:11.861436+00:00 test-server charon: 03[KNL] querying SAD entry with SPI 0edd6ac7<br>2020-10-29T12:14:11.862045+00:00 test-server charon: 03[KNL] querying policy <a href="http://0.0.0.0/0">0.0.0.0/0</a> === <a href="http://198.18.64.2/32">198.18.64.2/32</a> out<br>2020-10-29T12:14:14.124703+00:00 test-server charon: 06[NET] received packet: from <anonymized client ip>[4500] to <anonymized server ip>[4500] (540 bytes)<br>2020-10-29T12:14:14.125303+00:00 test-server charon: 06[ENC] parsed IKE_AUTH request 8 [ EF(1/2) ]<br>2020-10-29T12:14:14.125708+00:00 test-server charon: 06[ENC] received duplicate fragment #1<br>2020-10-29T12:14:14.615193+00:00 test-server charon: 09[IKE] retransmit 2 of request with message ID 0<br>2020-10-29T12:14:14.615785+00:00 test-server charon: 09[NET] sending packet: from <anonymized server ip>[4500] to <anonymized client ip>[4500] (57 bytes)<br>2020-10-29T12:14:26.137108+00:00 test-server charon: 04[NET] received packet: from <anonymized client ip>[4500] to <anonymized server ip>[4500] (308 bytes)<br>2020-10-29T12:14:26.137733+00:00 test-server charon: 04[ENC] parsed IKE_AUTH request 8 [ EF(2/2) ]<br>2020-10-29T12:14:26.138252+00:00 test-server charon: 04[ENC] received fragment #2 of 2, reassembling fragmented IKE message<br>2020-10-29T12:14:26.138723+00:00 test-server charon: 04[ENC] parsed IKE_AUTH request 8 [ EAP/RES/TLS ]<br>2020-10-29T12:14:26.159290+00:00 test-server charon: 04[CFG] sending RADIUS Access-Request to server 'primary'<br>2020-10-29T12:14:26.159689+00:00 test-server charon: 04[CFG] received RADIUS Access-Challenge from server 'primary'<br>2020-10-29T12:14:26.160101+00:00 test-server charon: 04[IKE] EAP_TLS payload => 61 bytes @ 0x7fe924007890<br>2020-10-29T12:14:26.162082+00:00 test-server charon: 04[ENC] generating IKE_AUTH response 8 [ EAP/REQ/TLS ]<br></div><div><br></div><div>BR,</div><div>Totti</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 28, 2020 at 6:09 PM Tobias Brunner <<a href="mailto:tobias@strongswan.org">tobias@strongswan.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Totti,<br>
<br>
> Particularly it seems to<br>
> occur if the previous request is fragmented and has been already<br>
> responded and then receiving retransmission of already responded request<br>
> only partially. After that Strongswan server is not responding to next<br>
> request coming from client.<br>
<br>
Yes, I can see how this may happen. The current defragmentation state<br>
is only cleared after all fragments of a message have been received.<br>
Until then, fragments of other messages are ignored because the message<br>
ID does not match. I've pushed a fix to the clear-defrag branch [1].<br>
<br>
Regards,<br>
Tobias<br>
<br>
[1]<br>
<a href="https://git.strongswan.org/?p=strongswan.git;a=shortlog;h=refs/heads/clear-defrag" rel="noreferrer" target="_blank">https://git.strongswan.org/?p=strongswan.git;a=shortlog;h=refs/heads/clear-defrag</a><br>
</blockquote></div>