Feature: add DST-PORT and SRC-PORT

This commit is contained in:
Dreamacro
2019-05-09 21:00:29 +08:00
parent cff4841f3e
commit 225c530d13
17 changed files with 137 additions and 59 deletions

View File

@ -24,10 +24,10 @@ func (g *GEOIP) RuleType() C.RuleType {
}
func (g *GEOIP) IsMatch(metadata *C.Metadata) bool {
if metadata.IP == nil {
if metadata.DstIP == nil {
return false
}
record, _ := mmdb.Country(*metadata.IP)
record, _ := mmdb.Country(*metadata.DstIP)
return record.Country.IsoCode == g.country
}