<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 19 Apr 2020 at 10:20, Andrew Cagney <<a href="mailto:andrew.cagney@gmail.com">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 dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 19 Apr 2020 at 06:57, Antony Antony <<a href="mailto:antony@phenome.org" target="_blank">antony@phenome.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">Dear fellow developers.<br>
<br>
I just noticed the IKEv2 IPsec rekey responder code has regressed beyond <br>
recognition! too many changes after the main regression:) While trying to <br>
figure out I notice logging and debugging lines changed too (possibly old) <br>
some with STATE_ and other without the prefix STATE_.  This make it hard to <br>
follow the regression. <br>
<br>
I suggest we take pause and retrace the steps. Also changing IKEv2 STATE_ is <br>
, as I recollect, discontented issue. And I feel change has been sneaked in.  <br>
Also use of some with STATE_ and others without "STATE_" is annoying.<br></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Main issue: rekey regression seems to started with 8abf1c415a.<br>
currently the pattern is <br>
<a href="https://testing.libreswan.org/v3.30-456-g8abf1c415a-master/ikev2-child-rekey/OUTPUT/east.pluto.log.gz" rel="noreferrer" target="_blank">https://testing.libreswan.org/v3.30-456-g8abf1c415a-master/ikev2-child-rekey/OUTPUT/east.pluto.log.gz</a><br>
<br>
child state #3: V2_CREATE_R0(established IKE SA) => V2_IPSEC_R(established CHILD SA)<br>
<br>
that state transition for #3 seems wrong, it is not re-key transition. I <br>
can't be sure because we have many log changes etc. But one thing is sure <br>
#master is taking same weird code path for IKEv2 rekey responder.<br></blockquote><div><br></div><div>So this:</div><div><br></div><div><pre style="color:rgb(0,0,0);white-space:pre-wrap">Apr  9 11:04:43.134196: | state #1 forced to match CREATE_CHILD_SA from STATE_V2_CREATE_R0->STATE_V2_IPSEC_R by ignoring from state
Apr  9 11:04:43.134276: | selected state microcode Respond to CREATE_CHILD_SA IPsec SA Request
Apr  9 11:04:43.134428: | #1 updating local interface from <a href="http://192.1.2.23:500" target="_blank">192.1.2.23:500</a> to <a href="http://192.1.2.23:500" target="_blank">192.1.2.23:500</a> using md->iface (in update_ike_endpoints() at state.c:2675)</pre></div><div>should have matched the child rekey transition?</div></div></div></blockquote><div><br></div><div>I'm testing a fix (two transitions got reversed).</div><div><br></div><div>Is there a test that shows fails after <span style="color:rgb(80,0,80)">8abf1c415a?</span></div><div> </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 class="gmail_quote"><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Before this regression: state transition appears to do the right thing.<br>
<br>
<a href="https://testing.libreswan.org/v3.30-455-g221d720f48-master/ikev2-child-rekey/OUTPUT/east.pluto.log.gz" rel="noreferrer" target="_blank">https://testing.libreswan.org/v3.30-455-g221d720f48-master/ikev2-child-rekey/OUTPUT/east.pluto.log.gz</a><br>
rekey seems to follow what is expected.<br>
<br>
child state #3: V2_CREATE_R0(established IKE SA) => V2_REKEY_CHILD_R0(established IKE SA)<br>
<br>
child state #3: V2_REKEY_CHILD_R0(established IKE SA) => <br>
V2_IPSEC_R(established CHILD SA)<br>
<br>
2. log/debug started using short names and mixing them with long state <br>
names.  This should not happen! Please keep the state names long and <br>
consistent.  <br>
<br>
switching IKEv2 <a href="http://MD.ST" rel="noreferrer" target="_blank">MD.ST</a> from CHILD #3 V2_CREATE_R0 to CHILD #3 V2_CREATE_R0 <br>
<br>
In some other parts of the log it is full name.<br>
<br>
please keep the full name.<br>
<br>
"east" #4 complete v2 state STATE_V2_REKEY_CHILD_R0 transition with <br>
STF_SUSPEND suspended from complete_v2_state_transition:3399 <br>
<br>
NOTE: because of changes to state names since 8abf1c415a  in master you will <br>
see. <br>
<br>
<a href="https://testing.libreswan.org/v3.30-507-ge06a82880f-master/ikev2-child-rekey/OUTPUT/east.pluto.log.gz" rel="noreferrer" target="_blank">https://testing.libreswan.org/v3.30-507-ge06a82880f-master/ikev2-child-rekey/OUTPUT/east.pluto.log.gz</a><br>
Apr 18 23:52:26.316312: | child state #3: V2_NEW_CHILD_R0(established IKE SA) => V2_IPSEC_R(established CHILD SA)<br>
<br>
It should be something like STATE_V2_REKEY_CHILD_R0 => STATE_V2_IPSEC_R(established)<br>
<br>
-antony<br>
<br>
PS: at first glance initiator code seems ok. Again hard to say becuase of <br>
log changes.<br>
_______________________________________________<br>
Swan-dev mailing list<br>
<a href="mailto:Swan-dev@lists.libreswan.org" target="_blank">Swan-dev@lists.libreswan.org</a><br>
<a href="https://lists.libreswan.org/mailman/listinfo/swan-dev" rel="noreferrer" target="_blank">https://lists.libreswan.org/mailman/listinfo/swan-dev</a><br>
</blockquote></div></div>
</blockquote></div></div>