GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Support for IP_BIND_ADDRESS_NO_PORT socket option, close #14195 by slandelle · Pull Request #14196 · netty/netty

Conversation

@slandelle

@slandelle slandelle commented Jul 21, 2024

Copy link
Copy Markdown
Contributor

Motivation:

From https://man7.org/linux/man-pages/man7/ip.7.html:

IP_BIND_ADDRESS_NO_PORT (since Linux 4.2)
Inform the kernel to not reserve an ephemeral port when using bind(2) with a port number of 0. The port will later be automatically chosen at connect(2) time, in a way that allows sharing a source port as long as the 4-tuple is unique.

See also these great blog posts from Cloudflare:

  • https://blog.cloudflare.com/how-to-stop-running-out-of-ephemeral-ports-and-start-to-love-long-lived-connections
  • https://blog.cloudflare.com/the-quantum-state-of-a-tcp-port

Supporting this option, introduced in Kernel 4.2, would help with use cases where a client is binding from multiple local addresses.

Modifications:

Introduce EpollChannelOption#IP_BIND_ADDRESS_NO_PORT .

This option is only for TCP and doesn't seem to work with UDP.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hyperxpro and standujar reacted with heart emoji
All reactions
  • ❤️ 2 reactions
@slandelle
slandelle force-pushed the feat-IP_BIND_ADDRESS_NO_PORT branch from 43d73b9 to cc33a28 Compare July 21, 2024 19:56
@slandelle
feat: Support for IP_BIND_ADDRESS_NO_PORT socket option, close #14195
5a01db8
Motivation:

From https://man7.org/linux/man-pages/man7/ip.7.html:

> IP_BIND_ADDRESS_NO_PORT (since Linux 4.2)
Inform the kernel to not reserve an ephemeral port when
using bind(2) with a port number of 0. The port will
later be automatically chosen at connect(2) time, in a way
that allows sharing a source port as long as the 4-tuple
is unique.

See also these great blog posts from Cloudflare:

* https://blog.cloudflare.com/how-to-stop-running-out-of-ephemeral-ports-and-start-to-love-long-lived-connections
* https://blog.cloudflare.com/the-quantum-state-of-a-tcp-port

Supporting this option, introduced in Kernel 4.2, would help with use cases where a client is binding from multiple local addresses.

Modifications:

Introduce `EpollChannelOption#IP_BIND_ADDRESS_NO_PORT `.

This option is only for TCP and doesn't seem to work with UDP.
@slandelle
slandelle force-pushed the feat-IP_BIND_ADDRESS_NO_PORT branch from cc33a28 to 5a01db8 Compare July 21, 2024 21:15
@slandelle
slandelle requested a review from normanmaurer July 22, 2024 05:42
@slandelle

slandelle commented Jul 22, 2024

Copy link
Copy Markdown
Contributor Author

@normanmaurer WDYT?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

normanmaurer
normanmaurer approved these changes Jul 22, 2024
View reviewed changes
@slandelle

slandelle commented Jul 23, 2024

Copy link
Copy Markdown
Contributor Author

Hey @normanmaurer
Anything missing?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer

normanmaurer commented Jul 23, 2024

Copy link
Copy Markdown
Member

All good ... feel free to merge in the relevant branches

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slandelle

slandelle commented Jul 23, 2024

Copy link
Copy Markdown
Contributor Author

Oki doki

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slandelle
slandelle merged commit c944afe into 4.1 Jul 23, 2024
@slandelle
slandelle deleted the feat-IP_BIND_ADDRESS_NO_PORT branch July 23, 2024 19:33
slandelle added a commit that referenced this pull request Jul 23, 2024
@slandelle
feat: Support for IP_BIND_ADDRESS_NO_PORT socket option, close #14195 (…
a74af21
…#14196)

Motivation:

From https://man7.org/linux/man-pages/man7/ip.7.html:

> IP_BIND_ADDRESS_NO_PORT (since Linux 4.2)
Inform the kernel to not reserve an ephemeral port when using bind(2)
with a port number of 0. The port will later be automatically chosen at
connect(2) time, in a way that allows sharing a source port as long as
the 4-tuple is unique.

See also these great blog posts from Cloudflare:

*
https://blog.cloudflare.com/how-to-stop-running-out-of-ephemeral-ports-and-start-to-love-long-lived-connections
* https://blog.cloudflare.com/the-quantum-state-of-a-tcp-port

Supporting this option, introduced in Kernel 4.2, would help with use
cases where a client is binding from multiple local addresses.

Modifications:

Introduce `EpollChannelOption#IP_BIND_ADDRESS_NO_PORT `.

This option is only for TCP and doesn't seem to work with UDP.
@slandelle

slandelle commented Jul 23, 2024

Copy link
Copy Markdown
Contributor Author

cherry-picked on 4.2

new PR for main: #14200

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

slandelle added a commit that referenced this pull request Jul 23, 2024
@slandelle
feat: Support for IP_BIND_ADDRESS_NO_PORT socket option, close #14195 (…
7d233f7
…#14196)

Motivation:

From https://man7.org/linux/man-pages/man7/ip.7.html:

> IP_BIND_ADDRESS_NO_PORT (since Linux 4.2)
Inform the kernel to not reserve an ephemeral port when using bind(2)
with a port number of 0. The port will later be automatically chosen at
connect(2) time, in a way that allows sharing a source port as long as
the 4-tuple is unique.

See also these great blog posts from Cloudflare:

*
https://blog.cloudflare.com/how-to-stop-running-out-of-ephemeral-ports-and-start-to-love-long-lived-connections
* https://blog.cloudflare.com/the-quantum-state-of-a-tcp-port

Supporting this option, introduced in Kernel 4.2, would help with use
cases where a client is binding from multiple local addresses.

Modifications:

Introduce `EpollChannelOption#IP_BIND_ADDRESS_NO_PORT `.

This option is only for TCP and doesn't seem to work with UDP.
This was referenced Sep 14, 2026
Http2: Reserve promised stream for PUSH_PROMISE after local RST_STREAM #17471
Closed
cache failure 1233e4a5 #17565
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@normanmaurer normanmaurer normanmaurer approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@slandelle @normanmaurer
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.