<div dir="ltr"><div style="font-size:13px;line-height:19.5px"><div style="display:inline!important">Hello Strongswan developers,</div><div><br></div><div>I looked at the HA plugin and if I understand correctly  in every sent packet , the plugin syncs only the mid , but not the packet content (I mean <a href="https://github.com/strongswan/strongswan/blob/08afc33e5259399a682bb62ef253b3155e68461e/src/libcharon/sa/ikev2/task_manager_v2.c#L122" target="_blank" style="z-index: 0;">task_manager->initiating.packets</a>and  <a href="https://github.com/strongswan/strongswan/blob/08afc33e5259399a682bb62ef253b3155e68461e/src/libcharon/sa/ikev2/task_manager_v2.c#L96" target="_blank" style="z-index: 0;">task_manager->responding.packets</a>)</div><div><br></div><div>I think  there are few cases where the IKE state synchronization will fail without  syncing the latest sent packet.</div><div>For example: </div><ol><li>The active VPN received request from peer  and tried to send response, but the machine crashed or there was problem in the network so the message wasn't sent, while the inactive VPN got HA message with the new MID. When the backing VPN will be activate the peer retransmit the request but because the VPN doesn't have the latest packet  it drops the retransmit request (see <a href="https://github.com/strongswan/strongswan/blob/08afc33e5259399a682bb62ef253b3155e68461e/src/libcharon/sa/ikev2/task_manager_v2.c#L1341" target="_blank" style="z-index: 0;">here</a>) and the IKE SA at the end will reset. </li><li>The active VPN tried to initiate exchange with the peer but the machine crashed or there was problem in network so the message wasn't sent ,while the inactive VPN got HA message with the new MID. When the backing VPN will  be activated it will try to send new messages but its MID of the our vpn now equal MID+1 of the peer VPN , and at the end the IKE SA will reset.</li></ol>It seems that syncing the latest packets will solve such cases.</div><div style="font-size:13px;line-height:19.5px">What do you think?</div><div style="font-size:13px;line-height:19.5px"><br></div><div style="font-size:13px;line-height:19.5px">Thanks,</div><div style="font-size:13px;line-height:19.5px">Avinoam</div></div>