Skip to content

Conversation

@copybara-service
Copy link

tcpip: fix IP_MTU_DISCOVER flag for tcp and udp

Fixes #12319

This patch only supports various IP_MTU_DISCOVER flags.
To fully support tracepath actually tracing the path the correct propagation of TTL exceeded is needed.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12366 from pkit:pmtu_probe_support 5ca5162

Fixes #12319

This patch only supports various IP_MTU_DISCOVER flags.
To fully support `tracepath` actually tracing the path the correct propagation of TTL exceeded is needed.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12366 from pkit:pmtu_probe_support 5ca5162
PiperOrigin-RevId: 844523992
@copybara-service copybara-service bot added the exported Issue was exported automatically label Dec 15, 2025
switch transErr.Kind() {
case stack.PacketTooBigTransportError:
handlePacketTooBig(transErr.Info())
if e.pmtud == tcpip.PMTUDiscoveryProbe {
Copy link

@aaltinaydev aaltinaydev Dec 15, 2025

Choose a reason for hiding this comment

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

Needs a lock here?

        e.mu.Lock()
		pmtud := e.pmtud
		e.mu.Unlock()
		if pmtud == tcpip.PMTUDiscoveryProbe {
			e.onICMPError(&tcpip.ErrMessageTooLong{}, transErr, pkt)
		} else {
			handlePacketTooBig(transErr.Info())
		}


case tcpip.MTUDiscoverOption:
switch v := tcpip.PMTUDStrategy(v); v {
case tcpip.PMTUDiscoveryWant, tcpip.PMTUDiscoveryDont, tcpip.PMTUDiscoveryDo:

Choose a reason for hiding this comment

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

Should we change this to the following?

		case tcpip.PMTUDiscoveryWant, tcpip.PMTUDiscoveryDont, tcpip.PMTUDiscoveryDo, tcpip.PMTUDiscoveryProbe:
			e.LockUser()
			e.pmtud = v
			e.UnlockUser()
		default:
			return &tcpip.ErrNotSupported{}
		}

Copy link

@aaltinaydev aaltinaydev left a comment

Choose a reason for hiding this comment

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

Test needs to be updated at third_party/gvisor/test/syscalls/linux/tcp_socket.cc Line:2360

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support IP_MTU_DISCOVER

2 participants