Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 27093 - emerge sync and v4 vs v6
Summary: emerge sync and v4 vs v6
Status: RESOLVED DUPLICATE of bug 37124
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-21 21:05 UTC by James Cloos
Modified: 2011-10-30 22:19 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to support make.conf RSYNC_IPV setting (rsync-ipv.patch,1.24 KB, patch)
2005-08-09 20:44 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Cloos 2003-08-21 21:05:36 UTC
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"]
Comment 1 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-07-30 07:41:47 UTC
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? :)
Comment 2 Zac Medico gentoo-dev 2005-08-09 20:44:18 UTC
Created attachment 65572 [details, diff]
patch to support make.conf RSYNC_IPV setting

Something like this?
Comment 3 James Cloos 2005-08-09 21:08:17 UTC
Something like [attachment 65572 [details, diff]]?

Looks good to me.
Comment 4 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-08-09 21:19:10 UTC
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.
Comment 5 James Cloos 2005-08-09 22:00:58 UTC
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.
Comment 6 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-08-09 22:14:38 UTC
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
Comment 7 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-08-09 22:17:21 UTC
*** Bug 37124 has been marked as a duplicate of this bug. ***
Comment 8 Bernhard Schmidt 2005-09-11 05:09:29 UTC
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.
Comment 9 Brian Harring (RETIRED) gentoo-dev 2005-09-18 08:40:10 UTC
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 ***