Unless -4 is passed to rsync, rsync://rsync.namerica.gentoo.org/gentoo-portage is only going to hit netpimpz on dual stack boxen. Some config file should allow an option that will cause emerge to prefer v4 or v6 by passing -4 or -6 to rsync(1). Both possibilities should be allowed, as some hosts will have better v6 connectivity and some better v4 connectivity.... Perhpaps is should be something like portage.settings["RSYNC_PREFER"]
We generally don't let users flip RSYNC options on and off due to the fact that our mirrors are hit often and we want users to use specific settings when syncing. However a simple setting in make.conf that says use v6 over v4 or vice versa should be easy to add...Jstubbs? :)
Created attachment 65572 [details, diff] patch to support make.conf RSYNC_IPV setting Something like this?
Something like [attachment 65572 [details, diff]]? Looks good to me.
Two things that jump out at me, does rsync die if both are specified, and if not can we change the patch to allow both. IE I have a ipv6 enabled host, and I'd like to use IPv6 enabled mirrors, but if none of the ipv6 mirrors are up I don't want syncing to die, I want ipv4 to be used. So either both are specified and rsync doesn't like them, thus you try ipv6, then 4, or rsync handles the difference for you.
Only the last setting of the two is effective. For connections to a remote rsync server, all it does is affect the hints parameter to the call to getaddrinfo(3). I cannot tell from the man page whether gettaddrinfo(3) returns all of the addresses when given a v4 or 6 hint, or whether it limits the list to only those that match the hint. Looking at glibc src, ... [time passes] ... I still can't tell.... ;-/ However, a quick test of: rsync -6 rsync.namerica.gentoo.org:: rsync -4 rsync.namerica.gentoo.org:: shows that the former only gets v6 addresses and does not fall back to v4.
There is a similar bug talking about emerge and it's handling of host resolution for rsync ( portage does the resolving for a couple of purposes. ). Perhaps this setting should affect the portage hint on it's resolution. default setting could be both IPv6 and IPv4, which means a 0 hint, otherwise the hint is the corresponding hint for ipv6 or ipv4, and we can merge these bugs ? bug 37124
*** Bug 37124 has been marked as a duplicate of this bug. ***
I currently don't get the purpose of this bug. Portage doesn't pass an hostname to rsync except it failed to resolve it on its own. In line 2498 the hostname is extracted from the SYNC_URI. In line 2509 this hostname is resolved to a list of IPv4(!)-addresses using gethostbyname_ex. Then basically each IP in this list is tried until rsync was successfully able to contact the remote host and it was not out of date. (The line numbers are from portage-2.0.52) Hostnames are never even tried, so adding --ipv4 or --ipv6 to the rsync-options is not helpful. It has to be done like in the patches I supplied in bug 37124, gethostbyname_ex has to be replaced with getaddrinfo (on user request? Maybe controlled by RSYNC_PREFER or similar) and then the literal IPv6 addresses can be passed to rsync as well. Unfortunately this can't be resolved until rsync-2.6.3 is marked stable, since prior versions can't cope with literal IPv6 addresses. Also see bug 37124.
duping this forward; the patch in 37124 solves the issue, but would prefer to integrate it slightly different in next major version. and yes, you can kick my ass if I don't have it done. ;) *** This bug has been marked as a duplicate of 37124 ***