From 2a678a7e03ff8b42b9621751ca6d0f8bdb4660a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 8 Jul 2026 19:19:07 +0800 Subject: [PATCH] Fix bridge MTU --- protocol/bridge/backend_darwin.go | 6 ------ protocol/bridge/backend_linux.go | 2 -- protocol/bridge/packet.go | 1 + protocol/bridge/packet_windows.go | 5 ----- 4 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 protocol/bridge/packet_windows.go diff --git a/protocol/bridge/backend_darwin.go b/protocol/bridge/backend_darwin.go index ae93311be..e4ad445b7 100644 --- a/protocol/bridge/backend_darwin.go +++ b/protocol/bridge/backend_darwin.go @@ -23,12 +23,6 @@ var ( bridgeInet6LocalBase = netip.MustParseAddr("2001:db8:1::1") ) -// The darwin forwarding path silently drops frames larger than the outgoing -// interface MTU (no ICMP, no counter), and virtualized ingress interfaces -// (vmnet LRO) deliver TCP frames coalesced far beyond their own 1500 MTU, so -// the bridge tun must accept full-size IP packets. -const bridgeTunMTU = 0xffff - type backendDarwin struct { backendBase diff --git a/protocol/bridge/backend_linux.go b/protocol/bridge/backend_linux.go index 3cd722751..734c6a5df 100644 --- a/protocol/bridge/backend_linux.go +++ b/protocol/bridge/backend_linux.go @@ -20,8 +20,6 @@ import ( const ( defaultBridgeRuleIndex = 100 defaultBridgeTableIndexBase = 2200 - - bridgeTunMTU = 1500 ) type backendLinux struct { diff --git a/protocol/bridge/packet.go b/protocol/bridge/packet.go index fec9c626b..f9e2f4159 100644 --- a/protocol/bridge/packet.go +++ b/protocol/bridge/packet.go @@ -13,6 +13,7 @@ import ( ) const ( + bridgeTunMTU = 0xffff maxPacketLength = 0xffff bridgeMaxInstances = 254 bridgeWriteBatchSize = 32 diff --git a/protocol/bridge/packet_windows.go b/protocol/bridge/packet_windows.go deleted file mode 100644 index 35ac1cf5c..000000000 --- a/protocol/bridge/packet_windows.go +++ /dev/null @@ -1,5 +0,0 @@ -//go:build windows && (amd64 || 386) - -package bridge - -const bridgeTunMTU = 1500