<div dir="ltr">Okay, the proper fix would be to make socket_connect loop over the results from gf_resolve_ip6; provided that hints.ai_family is removed from that method. By removing the preferred family hint; getaddrinfo will return all ip-addresses for a hostname (both v4 &amp; v6); which also fixes problems with hosts having multiple (v4 or v6) ip-addresses. If there would still be administrators that prefer ipv4 over ipv6 (when connecting to a peer that offers both) they should use gai.conf to alter the order from which those addresses would be tried in socket_connect.
<div><br></div><div>I have prepared an alternative patch which is a bit more simple but does the job; my rationale for these changes:</div><div><br></div><div>gf_resolve_ip6 should not accept a `family` filter; since we cannot know if ipv4 or ipv6 is preferable (esp. when using a hostname) we should return all matches; not just the ones that match only the (not-configurable default) ipv4 filter<br>
</div><div>socket_*_get_remote_sockaddr should use the result from af_inet_*_get_local_sockaddr to determine the family to use. Since we don&#39;t know this beforehand; the result is always better then the default (ipv4)<br>
</div><div><br></div><div>I have used glusterfs-3.5.0 + this patch + &#39;option transport.address-family inet6&#39; and have successfully probed both a ipv6 AND ipv4 peer by both hostname and address. The only issue I see that could arise from this change is the earlier mentioned host with both ipv4 &amp; ipv6. But the gai.conf should keep this configurable; and alternatively one could probe by IP directly.</div>
<div><br></div><div>Please let me know what you think!</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 6, 2014 at 10:06 AM, Niels de Vos <span dir="ltr">&lt;<a href="mailto:ndevos@redhat.com" target="_blank">ndevos@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Fri, Jun 06, 2014 at 09:26:12AM +0200, Sjon Hortensius wrote:<br>
&gt; That is a very definite and clear statement, thanks! When searching for<br>
&gt; gluster + ipv6; I found multiple people saying they have this working; or<br>
&gt; it should just work (from as far back as 2011). I assumed the same code<br>
&gt; should be in 3.5 and still be functional; but my assumption was incorrect.<br>
<br>
</div>There are some bugs filed that sound like the problem you are seeing:<br>
<br>
Bug 910836 - peer probe over ipv6 on ipv4/ipv6 network fails.<br>
Bug 922801 - Gluster not resolving hosts with IPv6 only lookups<br>
Bug 1070685 - glusterfs ipv6 functionality not working<br>
<br>
If you have additional information on issue, it&#39;ll be appreciated if you<br>
can add that. In case you have also noticed a different problem, please<br>
create a new bug for it.<br>
<br>
Some issues look relatively easy to solve. If that is indeed the case,<br>
don&#39;t hesitate to send patches. Of course, you&#39;re also welcome to send<br>
patches for complex bugs ;-)<br>
<br>
Thanks,<br>
Niels<br>
<div class=""><br>
&gt;<br>
&gt; Thanks for clarifying; that saves me some debugging.<br>
&gt;<br>
&gt; Sjon Hortensius<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Jun 5, 2014 at 8:07 PM, Justin Clift &lt;<a href="mailto:justin@gluster.org">justin@gluster.org</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; On 05/06/2014, at 4:20 PM, Sjon Hortensius wrote:<br>
&gt; &gt; &gt; After a bit of a struggle to get glusterfsd to listen to ipv6; I am now<br>
&gt; &gt; having problems trying to get the servers to &#39;peer probe&#39; each other.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I have tried peer probe on a ipv6-only hostname and an ipv6 address; but<br>
&gt; &gt; there doesn&#39;t seem to be any progress.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; common-utils.c:248:gf_resolve_ip6 always returns ipv4 addresses for<br>
&gt; &gt; hostnames while passing an ipv6 address results in &quot;getaddrinfo failed<br>
&gt; &gt; (Address family for hostname not supported)&quot;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I suspect this is caused by rpc_transport_inet_options_build which does<br>
&gt; &gt; &quot;dict_set_str (dict, &quot;transport.address-family&quot;, &quot;inet&quot;);&quot;; which I think<br>
&gt; &gt; should be &quot;inet/inet6&quot;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Can anybody confirm or deny this? Might there be a way to override this<br>
&gt; &gt; from the configuration? If any further information is useful I&#39;ll be happy<br>
&gt; &gt; to supply it.<br>
&gt; &gt;<br>
&gt; &gt; From memory, IPv6 support is something we&#39;re working on for GlusterFS<br>
&gt; &gt; 3.6.  It&#39;s probably not something we&#39;d really recommend with the current<br>
&gt; &gt; releases. :(<br>
&gt; &gt;<br>
&gt; &gt; + Justin<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Open Source and Standards @ Red Hat<br>
&gt; &gt;<br>
&gt; &gt; <a href="http://twitter.com/realjustinclift" target="_blank">twitter.com/realjustinclift</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
<br>
</div>&gt; _______________________________________________<br>
&gt; Gluster-users mailing list<br>
&gt; <a href="mailto:Gluster-users@gluster.org">Gluster-users@gluster.org</a><br>
&gt; <a href="http://supercolony.gluster.org/mailman/listinfo/gluster-users" target="_blank">http://supercolony.gluster.org/mailman/listinfo/gluster-users</a><br>
</blockquote></div><br></div>