This commit is contained in:
世界 2025-05-21 11:31:43 +08:00
parent 81d32181ce
commit c7ae180f57
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
3 changed files with 5 additions and 2 deletions

2
go.mod
View File

@ -26,7 +26,7 @@ require (
github.com/sagernet/gvisor v0.0.0-20241123041152-536d05261cff
github.com/sagernet/quic-go v0.49.0-beta.1
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691
github.com/sagernet/sing v0.6.9
github.com/sagernet/sing v0.6.10-0.20250521033217-30d675ea099b
github.com/sagernet/sing-dns v0.4.3
github.com/sagernet/sing-mux v0.3.2
github.com/sagernet/sing-quic v0.4.1-0.20250423030647-0eb05f373a76

3
go.sum
View File

@ -118,8 +118,9 @@ github.com/sagernet/quic-go v0.49.0-beta.1 h1:3LdoCzVVfYRibZns1tYWSIoB65fpTmrwy+
github.com/sagernet/quic-go v0.49.0-beta.1/go.mod h1:uesWD1Ihrldq1M3XtjuEvIUqi8WHNsRs71b3Lt1+p/U=
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 h1:5Th31OC6yj8byLGkEnIYp6grlXfo1QYUfiYFGjewIdc=
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU=
github.com/sagernet/sing v0.6.9 h1:y/XJH17oyBd6hxgQtKnIdLXu7TsOHxO5i1JeVfVmjXw=
github.com/sagernet/sing v0.6.9/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
github.com/sagernet/sing v0.6.10-0.20250521033217-30d675ea099b h1:E9zgBma90grCIC1Rber6UgGw3CzbpeizJdavNu1Fy8M=
github.com/sagernet/sing v0.6.10-0.20250521033217-30d675ea099b/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
github.com/sagernet/sing-dns v0.4.3 h1:R6X9oWYbdZ0Mm+8PkdqrBkqx3JwiAbnETUZGOpEdY4E=
github.com/sagernet/sing-dns v0.4.3/go.mod h1:dweQs54ng2YGzoJfz+F9dGuDNdP5pJ3PLeggnK5VWc8=
github.com/sagernet/sing-mux v0.3.2 h1:meZVFiiStvHThb/trcpAkCrmtJOuItG5Dzl1RRP5/NE=

View File

@ -299,6 +299,7 @@ func (r *NetworkManager) AutoDetectInterfaceFunc() control.Func {
if remoteAddr.IsValid() {
iif, err := r.interfaceFinder.ByAddr(remoteAddr)
if err == nil {
r.logger.Warn("bind to interface ", iif.Name, " (", iif.Index, "): ", remoteAddr)
return iif.Name, iif.Index, nil
}
}
@ -306,6 +307,7 @@ func (r *NetworkManager) AutoDetectInterfaceFunc() control.Func {
if defaultInterface == nil {
return "", -1, tun.ErrNoRoute
}
r.logger.Warn("bind to default interface ", defaultInterface.Name, " (", defaultInterface.Index, "): ", remoteAddr)
return defaultInterface.Name, defaultInterface.Index, nil
})
}