Refactor endpoint listen

This commit is contained in:
世界
2026-07-17 10:44:40 +08:00
parent c8ee3497b2
commit 704b57cf3e
9 changed files with 102 additions and 34 deletions
+2 -2
View File
@@ -381,8 +381,8 @@ func (d *DefaultDialer) ListenSerialInterfacePacket(ctx context.Context, destina
return d.trackPacketConn(packetConn, nil)
}
func (d *DefaultDialer) WireGuardControl() control.Func {
return d.udpListener.Control
func (d *DefaultDialer) WireGuardControl() (control.Func, bool) {
return d.udpListener.Control, d.autoDetectBindFunc != nil && d.netns == ""
}
func (d *DefaultDialer) trackConn(conn net.Conn, err error) (net.Conn, error) {
+1 -1
View File
@@ -5,5 +5,5 @@ import (
)
type WireGuardListener interface {
WireGuardControl() control.Func
WireGuardControl() (control.Func, bool)
}