Skip to content

Compiling with DISABLE_NAGLE does not propogate tcp_proto_no and never sets TCP_NODELAY#3859

Merged
razvancrainea merged 1 commit intoOpenSIPS:3.6from
purecloudlabs:bug/tcp_nodelay
Apr 14, 2026
Merged

Compiling with DISABLE_NAGLE does not propogate tcp_proto_no and never sets TCP_NODELAY#3859
razvancrainea merged 1 commit intoOpenSIPS:3.6from
purecloudlabs:bug/tcp_nodelay

Conversation

@davidtrihy-genesys
Copy link
Copy Markdown
Contributor

Summary
Compiling with DISABLE_NAGLE does not set tcp_proto_no on TCP worker processes which causes the setsockopt for TCP_NODELAY to not be set when creating sockets

Details
Bug fix with 3.6 where this compile time define does not work anymore

Solution
getprotobyname("tcp"); is called in tcp_bind_listener which is only ever called in the TCP main process so the tcp_proto_no is always -1 in worker processes, the solution here was to just remove that call and use IPPROTO_TCP directly in the setsockopt the enums for the different protos in netinet/in.h are used in multiple different areas in the source code so changing TCP_NODELAY to use the enum directly matches the pattern of other socket options

Compatibility
It will make 3.6 behave consistently when the compile time flag is set.

@razvancrainea razvancrainea self-assigned this Apr 14, 2026
@razvancrainea
Copy link
Copy Markdown
Member

This sounds about right, thanks for taking care of it.

@razvancrainea razvancrainea merged commit 1c90d5d into OpenSIPS:3.6 Apr 14, 2026
55 of 59 checks passed
razvancrainea pushed a commit that referenced this pull request Apr 14, 2026
razvancrainea pushed a commit that referenced this pull request Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants