mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 23:47:07 -05:00
Fix usage of source in context
This commit is contained in:
parent
18e1ca85aa
commit
9716d7fdfe
@ -131,6 +131,10 @@ func (v *CIDRMatcher) Apply(ctx context.Context) bool {
|
|||||||
dest = proxy.DestinationFromContext(ctx)
|
dest = proxy.DestinationFromContext(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !dest.IsValid() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if !dest.Address.Family().Either(v2net.AddressFamilyIPv4, v2net.AddressFamilyIPv6) {
|
if !dest.Address.Family().Either(v2net.AddressFamilyIPv4, v2net.AddressFamilyIPv6) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -169,6 +173,10 @@ func (v *IPv4Matcher) Apply(ctx context.Context) bool {
|
|||||||
} else {
|
} else {
|
||||||
dest = proxy.DestinationFromContext(ctx)
|
dest = proxy.DestinationFromContext(ctx)
|
||||||
}
|
}
|
||||||
|
if !dest.IsValid() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if !dest.Address.Family().Either(v2net.AddressFamilyIPv4) {
|
if !dest.Address.Family().Either(v2net.AddressFamilyIPv4) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user