Fix usage of source in context

pull/330/merge
Darien Raymond 2017-01-27 20:38:01 +01:00
parent 18e1ca85aa
commit 9716d7fdfe
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 8 additions and 0 deletions

View File

@ -131,6 +131,10 @@ func (v *CIDRMatcher) Apply(ctx context.Context) bool {
dest = proxy.DestinationFromContext(ctx)
}
if !dest.IsValid() {
return false
}
if !dest.Address.Family().Either(v2net.AddressFamilyIPv4, v2net.AddressFamilyIPv6) {
return false
}
@ -169,6 +173,10 @@ func (v *IPv4Matcher) Apply(ctx context.Context) bool {
} else {
dest = proxy.DestinationFromContext(ctx)
}
if !dest.IsValid() {
return false
}
if !dest.Address.Family().Either(v2net.AddressFamilyIPv4) {
return false
}