<div dir="ltr"><div>Just found another gotya.  From the linux page:</div><div>  If service is NULL [which it is], then the port number of the returned socket addresses will be left uninitialized.</div><div>so it might be prudent to have the sockaddr_to_address_port() function accept and ignore the port when it is NULL.</div><div>(posix says a "network-level address" is returned, which might be secret code for don't read the port)<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 4 May 2021 at 12:50, 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"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 4 May 2021 at 07:47, 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">Looking at the results that came in overnight <a href="https://testing.libreswan.org/" target="_blank">https://testing.libreswan.org/</a><div>The core seems to be fixed.  However, the results are still taking a sizable hit; how does that compare to your local results?</div></div></blockquote><div><br></div><div> It looks like there's more than one challenge here:</div><div><br></div><div><pre>-> +whack error: IPv4 address must be exactly 4 bytes "192.1.3.209"</pre></div><div>err = data_to_address(res->ai_addr, res->ai_addrlen, aftoinfo(res->ai_family), dst);</div><div>In theory something like:</div><div>  ip_sockaddr sa = { .sa,sa = *res->ai_addr, .len = res->ai_addrlen, };</div><div>  sockaddr_to_address_port(&sa);</div><div>except I've my doubts that res->ai_addr is pointing to the full ip_sockaddr (it could be shorter for instance). So I'd guess:</div><div>  ip_sockaddr sa = { .len = res->sa_addrlen, };</div><div> passert(res->sa_addrlen < sizeof(<a href="http://sa.sa" target="_blank">sa.sa</a>))<br></div><div>  memcpy(&<a href="http://sa.sa" target="_blank">sa.sa</a>, res->ai_addr, res->sa_addrlen);</div><div>  ...</div><div>or expose an alternative interface</div><div><br></div><div><pre>-> -000 "named": failed to convert '<a href="http://right.libreswan.org" target="_blank">right.libreswan.org</a>' at load time: not a numeric IPv4 address and name lookup failed (no validation performed)
-> +000 "named": failed to convert '<a href="http://right.libreswan.org" target="_blank">right.libreswan.org</a>' at load time: Name or service not known</pre></div><div>I'm not sure if we want to expose linux's idea of errors; if nothing else it will churn output</div><div><br></div><div>-> <a href="https://testing.libreswan.org/v4.4-79-g1dad494d64-main/ikev2-x509-07-san-ip-mismatch/OUTPUT/west.console.diff" target="_blank">https://testing.libreswan.org/v4.4-79-g1dad494d64-main/ikev2-x509-07-san-ip-mismatch/OUTPUT/west.console.diff</a></div><div>this has me stumped; I guess a bad ip fed in somewhere and the connection should have been dropped instead of loaded?!?!<br></div><div><br></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"><div dir="ltr"><div>Any ideas on fixing that function's portability?</div></div></blockquote><div><br></div><div>Here's one thought.</div><div><br></div><div>Since POSIX doesn't specify the list's order, what about scanning the list looking for something we like.  At least for when the family wasn't specified?</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><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 4 May 2021 at 00:23, D. Hugh Redelmeier <<a href="mailto:hugh@mimosa.com" target="_blank">hugh@mimosa.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">| From: Andrew Cagney <<a href="mailto:andrew.cagney@gmail.com" target="_blank">andrew.cagney@gmail.com</a>><br>
<br>
| FYI,<br>
| <a href="https://testing.libreswan.org/v4.4-73-g379929c054-main/ikev2-ddns-03/OUTPUT/west.console.diff" rel="noreferrer" target="_blank">https://testing.libreswan.org/v4.4-73-g379929c054-main/ikev2-ddns-03/OUTPUT/west.console.diff</a><br>
<br>
Thanks.<br>
<br>
Could you see if my latest commit fixes the problem.<br>
<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>
</blockquote></div></div></div>
</blockquote></div>