Skip to content

Commit

Permalink
Try to fix expiration date
Browse files Browse the repository at this point in the history
  • Loading branch information
mreiger committed Aug 29, 2024
1 parent c05d4f1 commit 42d089e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/dns/dnscache.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (e *ipEntry) addAndUpdateIPs(rrs []dnsgo.RR, lookupTime time.Time) (newIPs
if _, ok := e.ips[s]; ok {
newIPs = append(newIPs, nftables.SetElement{Key: []byte(s)})
}
e.ips[s] = lookupTime.Add(time.Duration(rr.Header().Ttl))
e.ips[s] = lookupTime.Add(time.Duration(rr.Header().Ttl * uint32(time.Second)))

}
return
Expand Down Expand Up @@ -396,6 +396,7 @@ func (c *DNSCache) updateIPEntry(qname string, rrs []dnsgo.RR, lookupTime time.T
}

setName := ipe.setName
scopedLog.WithValues("set", setName, "lookupTime", lookupTime, "rrs", rrs).Info("updating ip entry")
if err := ipe.update(setName, rrs, lookupTime, dtype); err != nil {
return fmt.Errorf("failed to update ipEntry: %w", err)
}
Expand Down

0 comments on commit 42d089e

Please sign in to comment.