Skip to content

net: fallback to IPv6-only when dual-stack bind fails - #65669

Open
suii2210 wants to merge 1 commit into
nodejs:mainfrom
suii2210:fix-ipv6-only-bind
Open

net: fallback to IPv6-only when dual-stack bind fails#65669
suii2210 wants to merge 1 commit into
nodejs:mainfrom
suii2210:fix-ipv6-only-bind

Conversation

@suii2210

Copy link
Copy Markdown

Summary

When IPv4 is unavailable, Node.js may fail while creating the default IPv6 dual-stack listening socket. Setting IPV6_V6ONLY=0 can return EAFNOSUPPORT, after which the existing code falls back to IPv4, which is also unavailable.

This change retries the IPv6 bind with UV_TCP_IPV6ONLY enabled before falling back to IPv4.

Tests

  • Added test/sequential/test-net-server-listen-ipv6-only-system.js
  • tools/test.py test/sequential/test-net-server-listen-ipv6-only-system.js
  • make lint

Refs: #65400

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. net Issues and PRs related to the net subsystem. labels Aug 30, 2026
@suii2210
suii2210 force-pushed the fix-ipv6-only-bind branch 3 times, most recently from 434e58f to feaf676 Compare August 30, 2026 17:09
@MikeMcC399

Copy link
Copy Markdown
Contributor

Please make sure you have read and understood the following documents:

The advice in the above documents says that you may use the Slack channel if your PR is not getting attention. That means you should be patient and wait. Posting to Slack 20 minutes after opening your PR is too fast by a long way.

Signed-off-by: suii2210 <work8758@gmail.com>
@suii2210
suii2210 force-pushed the fix-ipv6-only-bind branch from feaf676 to 4d6af84 Compare August 30, 2026 17:25
@suii2210

Copy link
Copy Markdown
Author

Please make sure you have read and understood the following documents:

The advice in the above documents says that you may use the Slack channel if your PR is not getting attention. That means you should be patient and wait. Posting to Slack 20 minutes after opening your PR is too fast by a long way.

I’m really sorry for the inconvenience 🥺. I’ll be more patient from now on and will make sure I don’t repeat this mistake again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. net Issues and PRs related to the net subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants