Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Multipath TCP support#931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
pluknet wants to merge2 commits intonginx:master
base:master
Choose a base branch
Loading
frompluknet:mptcp
Open

Multipath TCP support#931

pluknet wants to merge2 commits intonginx:masterfrompluknet:mptcp

Conversation

@pluknet
Copy link
Contributor

this adds a preparatory change to reduce diff, where appropriate, and therefore deduplicate the main change

@pluknetpluknet requested a review fromarutOctober 16, 2025 18:27
@pluknetpluknet self-assigned thisOct 16, 2025
@Maryna-f5Maryna-f5 added this to thenginx-1.29.3 milestoneOct 16, 2025
When configured, enables Multipath TCP support on a listen socket.Multipath TCP (MPTCP), standardized in RFC 8684, is enabled with aseparate IPPROTO_MPTCP socket(2) protocol.  As of now it works onLinux starting with Linux 5.6 and glibc 2.32.To avoid EADDRINUSE errors in bind() and listen() when transitioningbetween sockets with different protocols, SO_REUSEPORT is temporarilyset on both sockets.  Seef7f1607 for potential implications.Based on previous work by Maxime Dourov and Anthony Doeraene.
@pluknet
Copy link
ContributorAuthor

Changes: getsockopt(SO_PROTOCOL) moved under SOCK_STREAM

Comment on lines +667 to +685
#if (NGX_HAVE_REUSEPORT)

if (!ls[i].reuseport&&ls[i].change_protocol&& !ngx_test_config) {
if (ngx_noreuseport(s)==-1) {
ngx_log_error(NGX_LOG_EMERG,log,ngx_socket_errno,
ngx_noreuseport_n" %V failed",
&ls[i].addr_text);

if (ngx_close_socket(s)==-1) {
ngx_log_error(NGX_LOG_EMERG,log,ngx_socket_errno,
ngx_close_socket_n" %V failed",
&ls[i].addr_text);
}

returnNGX_ERROR;
}
}
#endif

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What's the point in resetting the reuseport option here?

BTW, when switching from a reuseport-enabled to no-reuseport listen, we do not reset the reuseport flag socket option.

ls[i].remain=1;

if (ls[i].protocol!=nls[n].protocol) {
nls[n].change_protocol=1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Here, we first inheritfd and then rewrite it inngx_open_listening_sockets(). It means that we need to be careful when handling errors below. If an error happens before the rewrite, thefd should be ignored (this actually happens now, see theopen flag below). However, if an error happens after the rewrite, the newfd should be closed. The latter does not happen since multipath listenings havels->open == 0 . This will lead to a socket leak.


if (ngx_strcmp(value[n].data,"multipath")==0) {
#ifdefIPPROTO_MPTCP
lsopt.protocol=IPPROTO_MPTCP;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Shouldn't it be a socket parameter (set flag) ? Not sure aboutbind, it may also be needed.

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

Reviewers

@arutarutarut requested changes

+1 more reviewer

@roman-f5roman-f5roman-f5 requested changes

Reviewers whose approvals may not affect merge requirements

Requested changes must be addressed to merge this pull request.

Assignees

@pluknetpluknet

Labels

Projects

None yet

Milestone

nginx-1.29.5

Development

Successfully merging this pull request may close these issues.

4 participants

@pluknet@arut@roman-f5@Maryna-f5

[8]ページ先頭

©2009-2025 Movatter.jp