feat: traceroute (mtr) support for gVisor TUN and WireGuard tunnels#70
Open
xdqi wants to merge 3 commits into
Open
feat: traceroute (mtr) support for gVisor TUN and WireGuard tunnels#70xdqi wants to merge 3 commits into
xdqi wants to merge 3 commits into
Conversation
Add ICMP Time Exceeded and Destination Unreachable error handling to the ICMPForwarder, enabling traceroute (mtr) to work through gVisor-based TUN and WireGuard tunnels. - Add transport error loop for receiving ICMP errors via gVisor dispatch - Add SourceRewriter for NAT-aware ICMP error rewriting - Preserve original TTL/HopLimit when forwarding ICMP packets - Add platform-specific TTL setting via raw socket options - Handle ICMPv6 error forwarding with IPv6 header synthesis - Refactor ping session management and error listener setup
Add UDP and TCP raw socket support for DirectRoute, enabling mtr --udp and mtr --tcp to work through gVisor-based tunnels. - Add UDPDestination with raw socket sending and ICMP error matching - Add TCPDestination with raw SYN socket for TCP traceroute - Add TCP/UDP source rewriting in SourceRewriter - Integrate UDP/TCP DirectRoute handlers in gVisor forwarders - Add TTL guard for UDP DirectRoute packets - Add comprehensive tests for UDP DirectRoute and SourceRewriter
Extract DirectRoute logic from TCPForwarder/UDPForwarder into standalone wrapper functions, enabling any gVisor transport handler to be wrapped with DirectRoute support without code duplication. - Add WrapTCPHandlerWithDirectRoute and WrapUDPHandlerWithDirectRoute - Add MaxTracerouteHopLimit configuration for TUN stack - Add TTL decrement with ICMP Time Exceeded generation for VPN mode - Extract checkTracerouteTTL and setsockoptTTL helpers - TCPForwarder and UDPForwarder are now pure proxy forwarders
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add traceroute/mtr support through gVisor-based TUN and WireGuard tunnels, enabling ICMP, UDP and TCP traceroute modes.
Features
Dependencies
Changes
DirectRouteOptionsin stack setup