From 055f3fd843cecd531c821d7608e855bd8cc4317e Mon Sep 17 00:00:00 2001 From: Val Date: Wed, 13 Sep 2023 16:18:35 +0200 Subject: [PATCH] wgengine/magicsock: rename debugPMTUD() to debugEnablePMTUD() Make the debugknob variable name for enabling peer path MTU discovery match the env variable name. Updates #311 Signed-off-by: Val --- wgengine/magicsock/debugknobs.go | 7 +++++-- wgengine/magicsock/debugknobs_stubs.go | 2 +- wgengine/magicsock/peermtu_darwin.go | 2 +- wgengine/magicsock/peermtu_linux.go | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/wgengine/magicsock/debugknobs.go b/wgengine/magicsock/debugknobs.go index 567586cde..ee831a976 100644 --- a/wgengine/magicsock/debugknobs.go +++ b/wgengine/magicsock/debugknobs.go @@ -49,8 +49,11 @@ var ( // debugRingBufferMaxSizeBytes overrides the default size of the endpoint // history ringbuffer. debugRingBufferMaxSizeBytes = envknob.RegisterInt("TS_DEBUG_MAGICSOCK_RING_BUFFER_MAX_SIZE_BYTES") - // debugPMTUD enables path MTU discovery. Currently only sets the Don't Fragment sockopt. - debugPMTUD = envknob.RegisterBool("TS_DEBUG_ENABLE_PMTUD") + // debugEnablePMTUD enables the peer MTU feature, which does path MTU + // discovery on UDP connections between peers. Currently (2023-09-05) + // this only turns on the don't fragment bit for the magicsock UDP + // sockets. + debugEnablePMTUD = envknob.RegisterBool("TS_DEBUG_ENABLE_PMTUD") // Hey you! Adding a new debugknob? Make sure to stub it out in the debugknob_stubs.go // file too. ) diff --git a/wgengine/magicsock/debugknobs_stubs.go b/wgengine/magicsock/debugknobs_stubs.go index d4b9a9ee3..57cbdeae2 100644 --- a/wgengine/magicsock/debugknobs_stubs.go +++ b/wgengine/magicsock/debugknobs_stubs.go @@ -20,7 +20,7 @@ func debugAlwaysDERP() bool { return false } func debugUseDERPHTTP() bool { return false } func debugEnableSilentDisco() bool { return false } func debugSendCallMeUnknownPeer() bool { return false } -func debugPMTUD() bool { return false } +func debugEnablePMTUD() bool { return false } func debugUseDERPAddr() string { return "" } func debugUseDerpRouteEnv() string { return "" } func debugUseDerpRoute() opt.Bool { return "" } diff --git a/wgengine/magicsock/peermtu_darwin.go b/wgengine/magicsock/peermtu_darwin.go index 3b27bc4c6..7d626aefc 100644 --- a/wgengine/magicsock/peermtu_darwin.go +++ b/wgengine/magicsock/peermtu_darwin.go @@ -31,5 +31,5 @@ func setDontFragment(pconn nettype.PacketConn, network string) (err error) { } func CanPMTUD() bool { - return debugPMTUD() // only if the envknob is for now. + return debugEnablePMTUD() // only if the envknob is for now. } diff --git a/wgengine/magicsock/peermtu_linux.go b/wgengine/magicsock/peermtu_linux.go index a407ccc33..b803f1a26 100644 --- a/wgengine/magicsock/peermtu_linux.go +++ b/wgengine/magicsock/peermtu_linux.go @@ -30,5 +30,5 @@ func setDontFragment(pconn nettype.PacketConn, network string) (err error) { } func CanPMTUD() bool { - return debugPMTUD() // only if the envknob is enabled, for now. + return debugEnablePMTUD() // only if the envknob is enabled, for now. }