Skip to content

Auto-enable IPv6 by default, unless disabled#3720

Open
softins wants to merge 1 commit into
jamulussoftware:mainfrom
softins:ipv6-auto-enable
Open

Auto-enable IPv6 by default, unless disabled#3720
softins wants to merge 1 commit into
jamulussoftware:mainfrom
softins:ipv6-auto-enable

Conversation

@softins
Copy link
Copy Markdown
Member

@softins softins commented May 30, 2026

Short description of changes

Auto-detects if the host supports IPv6, and enables it by default if so, unless explicitly disabled.

Removes -6 and --enableipv6, replacing them with --noipv6 to disable. If --noipv6 is not specified, it will try first to open an IPv6 socket, and if the host does not support it, will fall back to an IPv4 socket.

CSocket informs CClient or CServer of IPv6 availability via a passed-in reference.

The bool bEnableIPv6 is gone, and the actual availability of IPv6 is published by a method in CClient or CServer.

CHANGELOG: Client/Server: Enable IPv6 by default if supported by host. Provide option to disable manually.

Context: Fixes an issue?

Fixes #3300

Does this change need documentation? What needs to be documented and how?

The --noipv6 option should be documented, along with an explanation the IPv6 is always enabled on supporting hosts.

Status of this Pull Request

Tested locally on Linux and ready for review.

What is missing until this pull request can be merged?

Just review and testing on multiple platforms.

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

Removes -6 and --enableipv6, replacing with --noipv6.
If --noipv6 is not specified, it will try first to open an IPv6 socket,
and if the host does not support it, will fall back to an IPv4 socket.

CSocket informs CClient or CServer of IPv6 availability via a reference.

The bool bEnableIPv6 is gone, and the actual availability of IPv6 is
published by a method in CClient or CServer.
@softins softins added this to the Release 4.0.0 milestone May 30, 2026
@softins softins self-assigned this May 30, 2026
@softins softins added the feature request Feature request label May 30, 2026
@softins softins added this to Tracking May 30, 2026
@github-project-automation github-project-automation Bot moved this to Triage in Tracking May 30, 2026
@pljones
Copy link
Copy Markdown
Collaborator

pljones commented May 30, 2026

If a server operator uses --serverbindip 192.168.1.123, does this achieve the same effect?

Does --serverbindip support IPv6 addresses? Presumably there's no option of "fall back" if that works.

@softins
Copy link
Copy Markdown
Member Author

softins commented May 30, 2026

If a server operator uses --serverbindip 192.168.1.123, does this achieve the same effect?

Does --serverbindip support IPv6 addresses? Presumably there's no option of "fall back" if that works.

At the moment, and ever since we introduced basic IPv6 support five years ago (!), --serverbindip is ignored completely if the socket is AF_INET6 (dual-stack). It is only honoured if the socket is plain AF_INET. That means in existing versions that -6 was not supplied, and in the new version of this PR, that either --noipv6 is given, or the host does not have an IPv6 stack available.

I don't think binding a specific address to a dual-stack socket makes any sense, and probably doesn't work. If we wanted to provide that ability we would need to open two separate sockets, one for 4 and another for 6, so they could each be bound to a separate specific address. This would then involve using select() or poll() to handle them, instead of the blocking read loop we currently use. That would be a separate project for 4.1.0 or later!

Do you know what proportion of server operators actually use --serverbindip? I suspect it is extremely small.

For now, we could just stipulate that --serverbindip is only valid with --noipv6.

@pljones pljones moved this from Triage to In Progress in Tracking May 30, 2026
@pljones pljones moved this from In Progress to Waiting on Team in Tracking May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request Feature request

Projects

Status: Waiting on Team

Development

Successfully merging this pull request may close these issues.

Enable ipv6 client side support by default

2 participants