Skip to content

Commit

Permalink
Fix: ipset not only add ipv4 address
Browse files Browse the repository at this point in the history
  • Loading branch information
pcmid committed Apr 23, 2020
1 parent 36b2f5d commit 36eb53d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugin/ipset.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ func (i *Ipset) HandleDns(ctx *common.Context) {
for setName := range i.Domains {
if i.Domains[setName].Has(domain.Domain(ctx.Response.Question[0].Name)) {
for _, ans := range ctx.Response.Answer {
if ans.Header().Rrtype != dns.TypeA {
continue
}
err := i.Set[setName].Add(dns.Field(ans, 1), 0)
log.Debugf("ipset add %s to %s", ctx.Response.Question[0].Name, setName)
if err != nil {
Expand Down

0 comments on commit 36eb53d

Please sign in to comment.