File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,14 @@ func getCache() (*ifaceCache, error) {
84
84
continue // interface down
85
85
}
86
86
for _ , prefix := range ipNets {
87
- cache .ifTable .Insert (prefix , ifaceObj )
87
+ if _ , ok := cache .ifTable .Get (prefix ); ok {
88
+ // maybe two interfaces have the same prefix but different address,
89
+ // so we add a special /32(ipv4) or /128(ipv6) item to let ResolveInterfaceByAddr
90
+ // could find the correct interface
91
+ cache .ifTable .Insert (netip .PrefixFrom (prefix .Addr (), prefix .Addr ().BitLen ()), ifaceObj )
92
+ } else {
93
+ cache .ifTable .Insert (prefix , ifaceObj )
94
+ }
88
95
}
89
96
}
90
97
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ require (
25
25
github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759
26
26
github.com/metacubex/quic-go v0.52.1-0.20250522021943-aef454b9e639
27
27
github.com/metacubex/randv2 v0.2.0
28
- github.com/metacubex/sing v0.5.3-0.20250504031621-1f99e54c15b7
28
+ github.com/metacubex/sing v0.5.3
29
29
github.com/metacubex/sing-mux v0.3.2
30
30
github.com/metacubex/sing-quic v0.0.0-20250523120938-f1a248e5ec7f
31
31
github.com/metacubex/sing-shadowsocks v0.2.9
Original file line number Diff line number Diff line change @@ -116,8 +116,8 @@ github.com/metacubex/quic-go v0.52.1-0.20250522021943-aef454b9e639/go.mod h1:Kc6
116
116
github.com/metacubex/randv2 v0.2.0 h1:uP38uBvV2SxYfLj53kuvAjbND4RUDfFJjwr4UigMiLs =
117
117
github.com/metacubex/randv2 v0.2.0 /go.mod h1:kFi2SzrQ5WuneuoLLCMkABtiBu6VRrMrWFqSPyj2cxY =
118
118
github.com/metacubex/sing v0.5.2 /go.mod h1:ypf0mjwlZm0sKdQSY+yQvmsbWa0hNPtkeqyRMGgoN+w =
119
- github.com/metacubex/sing v0.5.3-0.20250504031621-1f99e54c15b7 h1:m4nSxvw46JEgxMzzmnXams+ebwabcry4Ydep/zNiesQ =
120
- github.com/metacubex/sing v0.5.3-0.20250504031621-1f99e54c15b7 /go.mod h1:ypf0mjwlZm0sKdQSY+yQvmsbWa0hNPtkeqyRMGgoN+w =
119
+ github.com/metacubex/sing v0.5.3 h1:QWdN16WFKMk06x4nzkc8SvZ7y2x+TLQrpkPoHs+WSVM =
120
+ github.com/metacubex/sing v0.5.3 /go.mod h1:ypf0mjwlZm0sKdQSY+yQvmsbWa0hNPtkeqyRMGgoN+w =
121
121
github.com/metacubex/sing-mux v0.3.2 h1:nJv52pyRivHcaZJKk2JgxpaVvj1GAXG81scSa9N7ncw =
122
122
github.com/metacubex/sing-mux v0.3.2 /go.mod h1:3rt1soewn0O6j89GCLmwAQFsq257u0jf2zQSPhTL3Bw =
123
123
github.com/metacubex/sing-quic v0.0.0-20250523120938-f1a248e5ec7f h1:mP3vIm+9hRFI0C0Vl3pE0NESF/L85FDbuB0tGgUii6I =
You can’t perform that action at this time.
0 commit comments