mirror of
https://github.com/safing/portmaster
synced 2025-09-11 07:24:36 +00:00
Handle DNS Rcodes
This commit is contained in:
parent
00de73d65e
commit
4e14439112
8 changed files with 53 additions and 22 deletions
|
@ -50,6 +50,7 @@ func (ifq *InFlightQuery) MakeCacheRecord(reply *dns.Msg) *RRCache {
|
|||
return &RRCache{
|
||||
Domain: ifq.Query.FQDN,
|
||||
Question: ifq.Query.QType,
|
||||
RCode: reply.Rcode,
|
||||
Answer: reply.Answer,
|
||||
Ns: reply.Ns,
|
||||
Extra: reply.Extra,
|
||||
|
@ -477,6 +478,10 @@ func (mgr *tcpResolverConnMgr) handleQueryResponse(conn *dns.Conn, msg *dns.Msg)
|
|||
|
||||
// persist to database
|
||||
rrCache := inFlight.MakeCacheRecord(msg)
|
||||
if !rrCache.Cacheable() {
|
||||
return
|
||||
}
|
||||
|
||||
rrCache.Clean(minTTL)
|
||||
err := rrCache.Save()
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue