public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/sync/modules/rsync/
Date: Sun, 26 May 2024 23:27:15 +0000 (UTC)	[thread overview]
Message-ID: <1716766028.a671334b7c7b64bc779f1c2bfb4ed659d97c0d19.sam@gentoo> (raw)

commit:     a671334b7c7b64bc779f1c2bfb4ed659d97c0d19
Author:     Pavel Balaev <mail <AT> void <DOT> so>
AuthorDate: Mon Mar 18 11:29:34 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun May 26 23:27:08 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a671334b

sync: don't use ipv6 for rsync when it's disabled

socket.has_ipv6 gives a false result:

$ sysctl net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.all.disable_ipv6 = 1
$ python
Python 3.11.8 (main, Feb 24 2024, 17:10:38) [GCC 13.2.1 20240210] on linux
>>> import socket
>>> socket.has_ipv6
True

This patch uses the portage.process.has_ipv6() function,
which returns the correct result.

Bug: https://bugs.gentoo.org/927241
Signed-off-by: Pavel Balaev <mail <AT> void.so>
Closes: https://github.com/gentoo/portage/pull/1309
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/sync/modules/rsync/rsync.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/portage/sync/modules/rsync/rsync.py b/lib/portage/sync/modules/rsync/rsync.py
index 15c3eb4da5..e89221ebc9 100644
--- a/lib/portage/sync/modules/rsync/rsync.py
+++ b/lib/portage/sync/modules/rsync/rsync.py
@@ -19,6 +19,7 @@ from portage import _unicode_decode
 from portage import os
 from portage.const import VCS_DIRS, TIMESTAMP_FORMAT, RSYNC_PACKAGE_ATOM
 from portage.output import create_color_func, yellow, blue, bold
+from portage.process import has_ipv6
 from portage.sync.getaddrinfo_validate import getaddrinfo_validate
 from portage.sync.syncbase import NewBase
 from portage.util import writemsg, writemsg_level, writemsg_stdout
@@ -252,9 +253,7 @@ class RsyncSync(NewBase):
             family = socket.AF_UNSPEC
             if "-4" in all_rsync_opts or "--ipv4" in all_rsync_opts:
                 family = socket.AF_INET
-            elif socket.has_ipv6 and (
-                "-6" in all_rsync_opts or "--ipv6" in all_rsync_opts
-            ):
+            elif has_ipv6() and ("-6" in all_rsync_opts or "--ipv6" in all_rsync_opts):
                 family = socket.AF_INET6
 
             addrinfos = None
@@ -278,7 +277,7 @@ class RsyncSync(NewBase):
             if addrinfos:
                 AF_INET = socket.AF_INET
                 AF_INET6 = None
-                if socket.has_ipv6:
+                if has_ipv6():
                     AF_INET6 = socket.AF_INET6
 
                 ips_v4 = []


             reply	other threads:[~2024-05-26 23:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-26 23:27 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-09-07 22:52 [gentoo-commits] proj/portage:master commit in: lib/portage/sync/modules/rsync/ Zac Medico
2020-08-03 19:30 Zac Medico
2019-08-30 17:38 Zac Medico
2019-01-03  7:11 Zac Medico
2018-07-23 19:42 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1716766028.a671334b7c7b64bc779f1c2bfb4ed659d97c0d19.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox