Skip to content

Epoll: Fix support for IP_RECVORIGDSTADDR#16461

Merged
normanmaurer merged 1 commit into
4.2from
epoll_ip_recvorigdstaddr
Mar 14, 2026
Merged

Epoll: Fix support for IP_RECVORIGDSTADDR#16461
normanmaurer merged 1 commit into
4.2from
epoll_ip_recvorigdstaddr

Conversation

@normanmaurer
Copy link
Copy Markdown
Member

Motivation:

We incorrectly used the return value of netty_unix_socket_getOption(...,IP_RECVORIGDSTADDR) and so did not correctly support IP_RECVORIGDSTADDR when using recvmmsg.

Modifications:

  • Correctly use the return value and also validate that the socket option is actually set before allocating the control message buffer.

Result:

Fix support of IP_RECVORIGDSTADDR when using recvmmsg

Motivation:

We incorrectly used the return value of netty_unix_socket_getOption(...,IP_RECVORIGDSTADDR) and so did not correctly support IP_RECVORIGDSTADDR when using recvmmsg.

Modifications:

- Correctly use the return value and also validate that the socket option is actually set before allocating the control message buffer.

Result:

Fix support of IP_RECVORIGDSTADDR when using recvmmsg
@normanmaurer normanmaurer added this to the 4.2.11.Final milestone Mar 13, 2026
@normanmaurer normanmaurer added needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. labels Mar 13, 2026
Copy link
Copy Markdown
Member

@chrisvest chrisvest left a comment

Choose a reason for hiding this comment

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

Maybe similar issues with checking the return value at
netty_kqueue_bsdsocket.c:277
netty_unix_socket.c:616
netty_unix_socket.c:1210
netty_unix_socket.c:1215

@normanmaurer
Copy link
Copy Markdown
Member Author

Maybe similar issues with checking the return value at
netty_kqueue_bsdsocket.c:277
netty_unix_socket.c:616
netty_unix_socket.c:1210
netty_unix_socket.c:1215

Will check these one by one and open a PR if there are more problems. Let me merge this one first.

@normanmaurer normanmaurer merged commit d97f5e6 into 4.2 Mar 14, 2026
37 of 40 checks passed
@normanmaurer normanmaurer deleted the epoll_ip_recvorigdstaddr branch March 14, 2026 14:11
netty-project-bot pushed a commit that referenced this pull request Mar 14, 2026
Motivation:

We incorrectly used the return value of
netty_unix_socket_getOption(...,IP_RECVORIGDSTADDR) and so did not
correctly support IP_RECVORIGDSTADDR when using recvmmsg.

Modifications:

- Correctly use the return value and also validate that the socket
option is actually set before allocating the control message buffer.

Result:

Fix support of IP_RECVORIGDSTADDR when using recvmmsg

(cherry picked from commit d97f5e6)
@netty-project-bot
Copy link
Copy Markdown
Contributor

Auto-port PR for 4.1: #16468

netty-project-bot pushed a commit that referenced this pull request Mar 14, 2026
Motivation:

We incorrectly used the return value of
netty_unix_socket_getOption(...,IP_RECVORIGDSTADDR) and so did not
correctly support IP_RECVORIGDSTADDR when using recvmmsg.

Modifications:

- Correctly use the return value and also validate that the socket
option is actually set before allocating the control message buffer.

Result:

Fix support of IP_RECVORIGDSTADDR when using recvmmsg

(cherry picked from commit d97f5e6)
@netty-project-bot
Copy link
Copy Markdown
Contributor

Auto-port PR for 5.0: #16469

@github-actions github-actions Bot removed the needs-cherry-pick-4.1 This PR should be cherry-picked to 4.1 once merged. label Mar 14, 2026
@github-actions github-actions Bot removed the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Mar 14, 2026
normanmaurer added a commit that referenced this pull request Mar 16, 2026
Auto-port of #16461 to 5.0
Cherry-picked commit: d97f5e6

---
Motivation:

We incorrectly used the return value of
netty_unix_socket_getOption(...,IP_RECVORIGDSTADDR) and so did not
correctly support IP_RECVORIGDSTADDR when using recvmmsg.

Modifications:

- Correctly use the return value and also validate that the socket
option is actually set before allocating the control message buffer.

Result:

Fix support of IP_RECVORIGDSTADDR when using recvmmsg

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
normanmaurer added a commit that referenced this pull request Mar 16, 2026
Auto-port of #16461 to 4.1
Cherry-picked commit: d97f5e6

---
Motivation:

We incorrectly used the return value of
netty_unix_socket_getOption(...,IP_RECVORIGDSTADDR) and so did not
correctly support IP_RECVORIGDSTADDR when using recvmmsg.

Modifications:

- Correctly use the return value and also validate that the socket
option is actually set before allocating the control message buffer.

Result:

Fix support of IP_RECVORIGDSTADDR when using recvmmsg

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
@normanmaurer
Copy link
Copy Markdown
Member Author

Maybe similar issues with checking the return value at
netty_kqueue_bsdsocket.c:277

This is correct as we want to handle the error case here...

netty_unix_socket.c:616

This one is correct as well.

netty_unix_socket.c:1210

Correct as netty_unix_socket_getOption will throw if < 0

netty_unix_socket.c:1215

Correct as netty_unix_socket_getOption will throw if < 0

Will check these one by one and open a PR if there are more problems. Let me merge this one first.

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.

3 participants