Skip to content

net: Support all valid IP_MTU_DISCOVER values for UDP and TCP#12852

Merged
copybara-service[bot] merged 1 commit intogoogle:masterfrom
tanyifeng:net-ip-mtu-discover
Apr 3, 2026
Merged

net: Support all valid IP_MTU_DISCOVER values for UDP and TCP#12852
copybara-service[bot] merged 1 commit intogoogle:masterfrom
tanyifeng:net-ip-mtu-discover

Conversation

@tanyifeng
Copy link
Copy Markdown
Contributor

The UDP endpoint only accepted PMTUDiscoveryDont and the TCP endpoint rejected PMTUDiscoveryProbe, causing QUIC libraries (quic-go) to fail when setting IP_PMTUDISC_DO or IP_PMTUDISC_PROBE on UDP sockets.

Accept all valid PMTUD strategies (DONT/WANT/DO/PROBE) for both UDP and TCP, since gVisor does not implement ICMP-based PMTU feedback, PROBE and DO are functionally equivalent — both set DF but neither updates a cached route PMTU.

Test: UdpSocketTest.SetPMTUD, TcpSocketTest.SetPMTUD

The UDP endpoint only accepted PMTUDiscoveryDont and the TCP endpoint
rejected PMTUDiscoveryProbe, causing QUIC libraries (quic-go) to fail
when setting IP_PMTUDISC_DO or IP_PMTUDISC_PROBE on UDP sockets.

Accept all valid PMTUD strategies (DONT/WANT/DO/PROBE) for both UDP
and TCP, since gVisor does not implement ICMP-based PMTU feedback,
`PROBE` and `DO` are functionally equivalent — both set DF but neither
updates a cached route PMTU.

Test: UdpSocketTest.SetPMTUD, TcpSocketTest.SetPMTUD

Signed-off-by: Tan Yifeng <yiftan@tencent.com>
@tanyifeng
Copy link
Copy Markdown
Contributor Author

Problem

The UDP/datagram endpoint only accepted IP_PMTUDISC_DONT and rejected all other values (WANT/DO/PROBE). GetSockOptInt always returned a hardcoded DONT. The TCP endpoint accepted WANT/DONT/DO but explicitly rejected PROBE.

This breaks QUIC libraries like quic-go, which call setsockopt(IPPROTO_IP, IP_MTU_DISCOVER, IP_PMTUDISC_DO) (v0.38.x) or IP_PMTUDISC_PROBE (v0.48.x+) on UDP sockets to enable path MTU discovery. When both IPv4 and IPv6 DF settings fail, quic-go treats it as fatal — any program using QUIC (Syncthing, HTTP/3 servers, etc.) cannot start its listener.

copybara-service bot pushed a commit that referenced this pull request Apr 3, 2026
The UDP endpoint only accepted PMTUDiscoveryDont and the TCP endpoint rejected PMTUDiscoveryProbe, causing QUIC libraries (quic-go) to fail when setting IP_PMTUDISC_DO or IP_PMTUDISC_PROBE on UDP sockets.

Accept all valid PMTUD strategies (DONT/WANT/DO/PROBE) for both UDP and TCP, since gVisor does not implement ICMP-based PMTU feedback, `PROBE` and `DO` are functionally equivalent — both set DF but neither updates a cached route PMTU.

Test: UdpSocketTest.SetPMTUD, TcpSocketTest.SetPMTUD
FUTURE_COPYBARA_INTEGRATE_REVIEW=#12852 from tanyifeng:net-ip-mtu-discover 03548dc
PiperOrigin-RevId: 894078264
copybara-service bot pushed a commit that referenced this pull request Apr 3, 2026
The UDP endpoint only accepted PMTUDiscoveryDont and the TCP endpoint rejected PMTUDiscoveryProbe, causing QUIC libraries (quic-go) to fail when setting IP_PMTUDISC_DO or IP_PMTUDISC_PROBE on UDP sockets.

Accept all valid PMTUD strategies (DONT/WANT/DO/PROBE) for both UDP and TCP, since gVisor does not implement ICMP-based PMTU feedback, `PROBE` and `DO` are functionally equivalent — both set DF but neither updates a cached route PMTU.

Test: UdpSocketTest.SetPMTUD, TcpSocketTest.SetPMTUD
FUTURE_COPYBARA_INTEGRATE_REVIEW=#12852 from tanyifeng:net-ip-mtu-discover 03548dc
PiperOrigin-RevId: 894078264
@copybara-service copybara-service bot merged commit 0f29b0e into google:master Apr 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants