-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Allow not handled packets for UDP Forwarder #11850
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
Allow not handled packets for UDP Forwarder #11850
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
udp.NewForwarder()
has no non-test usages in gVisor...
Is this dead code we need to clean up? Or are you a Netstack package user and still want this functionality?
59c8c5a
to
9912f38
Compare
By Netstack, do you mean https://github.com/google/netstack? This functionality is very useful for handling packets coming from a TUN interface. |
By netstack, I meant https://github.com/google/gvisor/tree/master/pkg/tcpip. The netstack repo you linked was internalized into the gVisor repo some time back. |
pls fix the cla/google check |
Done. |
For TCP forwarder, we can reset the connection with r.Complete(true). For UDP forwarder, there was no way to reset the connection. gVisor already sends ICMP port unreachable for unhandled packets, but udp.Forwarder.HandlePacket always returns true. So we change the handler's function signature to return a bool type value, indicating whether the packet was handled or not. Thus allowing us to send ICMP port unreachable for failed UDP connections. FUTURE_COPYBARA_INTEGRATE_REVIEW=#11850 from OkamiW:udp-forwarder-not-handled-packets 9912f38 PiperOrigin-RevId: 777960633
Gentle ping. |
For TCP forwarder, we can reset the connection with r.Complete(true). For UDP forwarder, there was no way to reset the connection. gVisor already sends ICMP port unreachable for unhandled packets, but udp.Forwarder.HandlePacket always returns true. So we change the handler's function signature to return a bool type value, indicating whether the packet was handled or not. Thus allowing us to send ICMP port unreachable for failed UDP connections.
9912f38
to
496c218
Compare
For TCP forwarder, we can reset the connection with r.Complete(true). For UDP forwarder, there was no way to reset the connection. gVisor already sends ICMP port unreachable for unhandled packets, but udp.Forwarder.HandlePacket always returns true. So we change the handler's function signature to return a bool type value, indicating whether the packet was handled or not. Thus allowing us to send ICMP port unreachable for failed UDP connections. FUTURE_COPYBARA_INTEGRATE_REVIEW=#11850 from OkamiW:udp-forwarder-not-handled-packets 496c218 PiperOrigin-RevId: 777960633
For TCP forwarder, we can reset the connection with r.Complete(true). For UDP forwarder, there was no way to reset the connection. gVisor already sends ICMP port unreachable for unhandled packets, but udp.Forwarder.HandlePacket always returns true. So we change the handler's function signature to return a bool type value, indicating whether the packet was handled or not. Thus allowing us to send ICMP port unreachable for failed UDP connections. FUTURE_COPYBARA_INTEGRATE_REVIEW=#11850 from OkamiW:udp-forwarder-not-handled-packets 496c218 PiperOrigin-RevId: 777960633
For TCP forwarder, we can reset the connection with r.Complete(true). For UDP forwarder, there was no way to reset the connection. gVisor already sends ICMP port unreachable for unhandled packets, but udp.Forwarder.HandlePacket always returns true. So we change the handler's function signature to return a bool type value, indicating whether the packet was handled or not. Thus allowing us to send ICMP port unreachable for failed UDP connections. FUTURE_COPYBARA_INTEGRATE_REVIEW=#11850 from OkamiW:udp-forwarder-not-handled-packets 496c218 PiperOrigin-RevId: 777960633
Gentle ping. |
For TCP forwarder, we can reset the connection with r.Complete(true). For UDP forwarder, there was no way to reset the connection. gVisor already sends ICMP port unreachable for unhandled packets, but udp.Forwarder.HandlePacket always returns true. So we change the handler's function signature to return a bool type value, indicating whether the packet was handled or not. Thus allowing us to send ICMP port unreachable for failed UDP connections. FUTURE_COPYBARA_INTEGRATE_REVIEW=#11850 from OkamiW:udp-forwarder-not-handled-packets 496c218 PiperOrigin-RevId: 783025458
For TCP forwarder, we can reset the connection with r.Complete(true). For UDP forwarder, there was no way to reset the connection.
gVisor already sends ICMP port unreachable for unhandled packets, but udp.Forwarder.HandlePacket always returns true.
So we change the handler's function signature to return a bool type value, indicating whether the packet was handled or not. Thus allowing us to send ICMP port unreachable for failed UDP connections.