<div dir="ltr"><div dir="ltr">(luckily I occasionally read spam)<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 21 May 2021 at 08:54, Paul Wouters <<a href="mailto:paul.wouters@aiven.io">paul.wouters@aiven.io</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"><br>
commit b6e986fb7181fe6288dbba3fb98832b53aee1415<br>
Author: Andrew Cagney <<a href="mailto:cagney@gnu.org" target="_blank">cagney@gnu.org</a>><br>
Date:   Thu May 20 11:21:33 2021 -0400<br>
<br>
     ikev2: only count empty informational messages as liveness probes<br>
<br>
     was including informational messages with notify payloads<br>
<br>
<br>
<br>
This is not correct through. Any informational message can contain<br>
notify payloads. In theory they should all include NAT detection<br>
payloads in case a NAT appeared out of nowhere.<br></blockquote><div><br></div><pre class="gmail-newpage">   An INFORMATIONAL request with no payloads (other than the
   empty Encrypted payload required by the syntax) is commonly used as a
   check for liveness.  These subsequent exchanges cannot be used until
   the initial exchanges have completed.</pre><div>So I think this:</div><div style="margin-left:40px">       /*<br>     * Only count empty requests as liveness probes.<br>       */<br>   if (md->chain[ISAKMP_NEXT_v2SK]->payload.v2gen.isag_np == ISAKMP_NEXT_NONE) {<br></div><div style="margin-left:40px"><div style="margin-left:40px">           pstats_ike_dpd_replied++;<br></div></div><div style="margin-left:40px">       }</div><div>is correct.</div><div><br></div><div>However, to your point, we might as well count what type of payloads (D, N, CP) were in the informational message?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
But also, every exchange message that proved it is a new sequence number<br>
counts as "liveness probe". So if a REKEY happens, the "liveness" should<br>
also be updated.<br>
<br></blockquote></div><div class="gmail_quote"><div class="gmail_quote"><br></div><div class="gmail_quote">This is why I filed <a href="https://github.com/libreswan/libreswan/issues/446">https://github.com/libreswan/libreswan/issues/446</a><br></div></div><div class="gmail_quote">I'll make the .st_last_liveness update unconditional, which is less wrong than the original code.<br></div><div><div> <br></div></div></div>