<div dir="ltr"><div>To make the problem more concrete, consider  two connections c-1 and c-2 want to share the same IKE SA.</div><div><br></div><div>First, I believe liveness=hold and policy revive are in conflict.  For instance, say "c-1" triggers a liveness event which times out.  Should "c-1" follow liveness=hold or policy revival?  What about when "c-1"'s rekey fails? ...<br></div><div><br></div><div>Here are some scenarios and what happens today (vs yesterday).  In each the question is what _should_ happen.<br></div><div><br></div><div>- c-1 initiates; c-2 put on pending queue<br></div><div>-> retransmits call ipsecdoi_replace("c-1", try)</div><div>-? but what happens to c-2 remains on the pending queue?<br></div><div><br></div><div>- c-1 established; c-2 initiates (I'm assuming this uses retransmits)<br></div><div>-> retransmits call liveness_action("c-2") because the IKE SA is established and "c-2" initiated the exchange</div><div>-> see above, what should happen to "c-1" and does it?<br></div><div><br></div><div>- c-1 established; c2 established; c-1 or c-2 triggers liveness</div><div>-> retransmits call liveness_action("c-1") because retransmits use the IKE SA and the IKE SA is established and liveness action is called with st->st_connection<br></div><div><br></div><div>- c-1 established; c2 established; c-1 or c-2 rekey<br></div><div>either of<br></div><div>-> retransmits call liveness_action("new c-[12]") because the new child initiated the exchange and the IKE SA is established</div><div>-> replace calls v2_event_sa_replace(st) - you need to read its comments - I suspect it should queue up a delete exchange and then let retransmits kill the IKE SA<br></div><br><div>tests would be nice<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 28 Apr 2020 at 12:05, Andrew Cagney <<a href="mailto:andrew.cagney@gmail.com" target="_blank">andrew.cagney@gmail.com</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"><div dir="ltr"><div>Adding to the list of functions that revive ...<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 27 Apr 2020 at 12:06, Andrew Cagney <<a href="mailto:andrew.cagney@gmail.com" target="_blank">andrew.cagney@gmail.com</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"><div dir="ltr"><div>I just pushed code to implement liveness probes using the retransmit timer.  When retransmits time-out:</div><div><br></div><div>- if the IKE SA hasn't established, it does a 'retry' using ipsecdoi_replace(st, try)<br></div><div><br></div><div>- else, presumably the IKE SA is established, and it calls liveness_action(); I suspect this doesn't handle multiple children, and know it won't handle an IKE exchange timing out<br></div><div><br></div><div>(there's also add_revival(), but I'm not sure if that applies here?  And there's pending ...)</div><div><br></div><div>So my question is what should happen?</div><div><br></div><div>- are the established and not established paths really that different (for instance an established IKE SA may have an incomplete CHILD SA)</div><div><br></div><div>- do established CHILD SAs linger so that the IPsec connection is 'up' (even though evidence suggests it is dead)</div><div><br></div><div>- and I have to wonder what the difference between replace and pending is</div></div></blockquote><div><br></div><div>- a rekey (the obvious next candidate for doing proper retransmits) calls  v2_event_sa_replace()</div><div><br></div></div></div>
</blockquote></div>