Skip to content

Commit b71080d

Browse files
authored
Merge pull request cyrusimap#5170 from rjbs/avoid-docker-ipv6-nonsense
avoid docker ipv6 nonsense
2 parents fc76ab8 + f95b2e7 commit b71080d

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
container:
1919
image: cyrusimapdocker/cyrus-bookworm:latest
20-
options: --sysctl net.ipv6.conf.all.disable_ipv6=0 --init
20+
options: --init
2121
steps:
2222
- uses: actions/checkout@v4
2323
with:

cassandane/Cassandane/Instance.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ sub start
12131213
Cassandane::Instance->get_version($self->{installation});
12141214

12151215
if ($maj > 3 || ($maj == 3 && $min >= 1)) {
1216-
my $host = 'localhost';
1216+
my $host = '127.0.0.1';
12171217
my $port = Cassandane::PortManager::alloc($host);
12181218

12191219
$self->{config}->set(

cassandane/Cassandane/PortManager.pm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@ sub port_is_free
8888
LocalPort => $port,
8989
Proto => 'tcp',
9090
ReuseAddr => 1,
91+
92+
# There's something odd going on with IO::Socket::IP's use of
93+
# getaddrinfo, such that if you provide "::1" as the local address, and
94+
# the loopback interface has inet6, but another (say, eth0) interface
95+
# does not, the behavior of AI_ADDRCONFIG will be to act as if the
96+
# system has no inet6 support, and so inet6 bindings should not be
97+
# offered. Something seems amiss, but I'm not sure where. Using 0
98+
# will allow ports on ::1 to seem available, though.
99+
# -- rjbs, 2024-12-14
100+
GetAddrInfoFlags => 0,
91101
);
92102

93103
unless ($socket) {

0 commit comments

Comments
 (0)