portage icon indicating copy to clipboard operation
portage copied to clipboard

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

Open 0x501D opened this issue 11 months ago • 8 comments

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 Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.has_ipv6
True

This patch uses the built-in _has_ipv6() function, which returns the correct result.

Bug: https://bugs.gentoo.org/927241

0x501D avatar Mar 18 '24 11:03 0x501D

Thanks @0x501D this looks great! Can you add a sign off to comply with our Certificate of Origin?

zmedico avatar Mar 18 '24 14:03 zmedico

Thanks @0x501D this looks great! Can you add a sign off to comply with our Certificate of Origin?

Sign off added.

0x501D avatar Mar 18 '24 14:03 0x501D

Linter errors was fixed.

0x501D avatar Mar 18 '24 15:03 0x501D

This patch uses the built-in _has_ipv6() function, which returns the correct result.

Nit: there is no "built-in" _has_ipv6() function. I would refer to portage.process._has_ipv6() instead.

floppym avatar Mar 18 '24 15:03 floppym

This patch uses the built-in _has_ipv6() function, which returns the correct result.

Nit: there is no "built-in" _has_ipv6() function. I would refer to portage.process._has_ipv6() instead.

Thanks. Commit message was fixed.

0x501D avatar Mar 18 '24 15:03 0x501D

I suppose we should remove the underscore from the front of the function name if we are going to call it from another module. It's no longer a "private" function.

floppym avatar Mar 20 '24 04:03 floppym

I suppose we should remove the underscore from the front of the function name if we are going to call it from another module. It's no longer a "private" function.

Done. Added in a separate commit.

0x501D avatar Mar 20 '24 14:03 0x501D

Perfect, thank you.

floppym avatar Mar 20 '24 16:03 floppym