<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 3 May 2021 at 13:54, D. Hugh Redelmeier <<a href="mailto:hugh@vault.libreswan.fi">hugh@vault.libreswan.fi</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">New commits:<br>
commit 379929c054bbe6022abbc456f5c1fd9bd453470d<br>
Author: D. Hugh Redelmeier <<a href="mailto:hugh@mimosa.com" target="_blank">hugh@mimosa.com</a>><br>
Date:   Mon May 3 12:37:40 2021 -0400<br>
<br>
    libswan/ttoaddress.c: use getaddrinfo(3) instead of gethostbyname2(3)<br>
<br>
    Modernization.  Much simplification.<br>
<br>
    I'm not sure if we lose support for hex representation of IP<br>
    addresses.  Unit tests still pass.<br>
<br>
    I'm not sure if what happens when putitive domain names contain bad<br>
    characters.  Unit tests still pass.<br>
<br>
    We always accept the first result from getaddrinfo(3).  This may<br>
    change prioritization of IPv4 vs IPv6, but at least it matches RFC<br>
    3484 (according to the man page).<br></blockquote><div><br></div><div>I'm not sure how much we want to trust getaddrinfo() to Do_The_Right_Thing here.</div><div><br></div><div>For instance, given a choice between IPv4 and IPv6 which will it return first?  The documentation I'm reading states:<br></div><div>     By default IPv6 address entries are ordered before IPv4 ones, but the<br>     order of the entries in the list can be controlled using ip6addrctl(8).<br></div><div>yet Pluto, at least for now, wants IPv4 to trump IPv6.  This so that existing configs don't magically switch protocols and wanders into into the suspect IPv6 tunneling IPv4 code path.<br></div></div><br><div class="gmail_quote">(my best guess at RFC 3484 is that it should prefer IPv4 because ::ffff:N.N.N.N will sort earlier, but I'm guessing and no documentation for getaddrinfo() even hits at it complying with that RFC?)<br></div><div class="gmail_quote"><div><br></div><div><br></div></div></div>