Skip to content

Conversation

@dumbbell
Copy link
Collaborator

@dumbbell dumbbell commented Oct 16, 2025

Why

If the system uses distinct listeners for IPv4 and IPv6, the functions listing or stopping listeners would crash because they assumed that the system would listen implicitly to IPv4 when starting an IPv6 listener. This is a common Linuxism.

How

The code now understands that a given protocol can have several associated listeners.

The name and return value of several exported functions changed to reflect that they work on several elements or return a list of elements. Therefore it is a breaking change for plugins relying on these functions.

@dumbbell dumbbell self-assigned this Oct 16, 2025
@dumbbell dumbbell marked this pull request as ready for review October 17, 2025 07:07
@dumbbell dumbbell force-pushed the support-distinct-ipv4-and-ipv6-listeners branch 2 times, most recently from 23bd799 to 2d6df3f Compare October 17, 2025 09:00
@dumbbell dumbbell added this to the 4.3.0 milestone Oct 17, 2025
[Why]
Some systems use explicit distinct listeners for IPv4 and IPv6 (for
instance, FreeBSD). Other system will listen to IPv4 implicitly when
listening on IPv6 (for instance, Linux).

RabbitMQ works on both systems already, but `ranch_ref/1` was trying to
guess the IP address of a given listener based on its TCP port. Of
course, for two distinct listeners using the same TCP port, the result
was always the same IP address.

[How]
The #listener{} record already contains the IP address. Let's just use
it, instead of guessing.
…nd IPv6

[Why]
If the system uses distinct listeners for IPv4 and IPv6, the functions
listing or stopping listeners would crash because they assumed that the
system would listen implicitly to IPv4 when starting an IPv6 listener.
This is a common Linuxism.

[How]
The code now understands that a given protocol can have several
associated listeners.

The name and return value of several exported functions changed to
reflect that they work on several elements or return a list of elements.
Therefore it is a breaking change for plugins relying on these
functions.
@dumbbell dumbbell force-pushed the support-distinct-ipv4-and-ipv6-listeners branch from 2d6df3f to 578c3a6 Compare October 17, 2025 10:35
@michaelklishin michaelklishin merged commit cf476c8 into main Oct 17, 2025
291 of 292 checks passed
@michaelklishin michaelklishin deleted the support-distinct-ipv4-and-ipv6-listeners branch October 17, 2025 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants