Fix source_ip_is_private matching

This commit is contained in:
dyhkwong 2024-03-19 16:00:43 +08:00
parent 59d437b9d2
commit dd47163bea

View File

@ -24,8 +24,8 @@ func (r *IPIsPrivateItem) Match(metadata *adapter.InboundContext) bool {
} else { } else {
destination = metadata.Destination.Addr destination = metadata.Destination.Addr
} }
if destination.IsValid() && !N.IsPublicAddr(destination) { if destination.IsValid() {
return true return !N.IsPublicAddr(destination)
} }
for _, destinationAddress := range metadata.DestinationAddresses { for _, destinationAddress := range metadata.DestinationAddresses {
if !N.IsPublicAddr(destinationAddress) { if !N.IsPublicAddr(destinationAddress) {