-
-
Notifications
You must be signed in to change notification settings - Fork 73
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use the destination ip of the incoming packet as the packet return source ip #557
Comments
In ctx.writeAndFlush(new DatagramPacket(out.writerIndex(outWriterIndex + res), sender, recipient)); |
No it will not... as far as I know it's not possible as the sender address is the one that the socket is "bound to". What you can do is to explicit bind a socket to a specify address when you bootstrap it. |
I'm really sorry, but I didn't quite understand how I was supposed to go about it |
What I was saying is that you can specify the address when creating the
|
Is that right? I did try it, but in my scenario, the destination ip of the packet can't be fixed, so it's harder to fulfill the requirement this way. |
Can you point me to the nginx impl of it ? |
Ok I found it... I suspect we could support it in netty but its not there atm: https://github.com/nginx/nginx/blob/master/src/os/unix/ngx_udp_sendmsg_chain.c#L246 |
The relevant code is here
|
Yes, this is the code. Do you have any ideas on how I can help? |
I just created netty/netty#13495. This will need to be implemented via JNI for the epoll transport. Not sure yet when I will have time to do so atm, so if you have experience with JNI you might want to work on a PR against netty. |
I'm glad you'll be able to support such a feature in the future. |
The text was updated successfully, but these errors were encountered: