Improve darwin bridge

This commit is contained in:
世界
2026-07-08 19:01:50 +08:00
parent c85b64ecad
commit f8d1638dd3
4 changed files with 14 additions and 1 deletions
+7
View File
@@ -23,6 +23,12 @@ 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
@@ -89,6 +95,7 @@ func (b *backendDarwin) start() error {
Logger: b.logger,
EXP_ExternalConfiguration: true,
EXP_MultiPendingPackets: true,
EXP_SendMsgX: true,
})
if err != nil {
return E.Cause(err, "create bridge tun")
+2
View File
@@ -20,6 +20,8 @@ import (
const (
defaultBridgeRuleIndex = 100
defaultBridgeTableIndexBase = 2200
bridgeTunMTU = 1500
)
type backendLinux struct {
-1
View File
@@ -13,7 +13,6 @@ import (
)
const (
bridgeTunMTU = 1500
maxPacketLength = 0xffff
bridgeMaxInstances = 254
bridgeWriteBatchSize = 32
+5
View File
@@ -0,0 +1,5 @@
//go:build windows && (amd64 || 386)
package bridge
const bridgeTunMTU = 1500