mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
Fix logic for failed DNS TXT lookups.
A failed request should not evict a previous result from the local cache/mapping.
This commit is contained in:
parent
3c37e818ce
commit
2203600e05
1 changed files with 9 additions and 7 deletions
|
@ -711,17 +711,19 @@ void DNS_Mgr::AddResult(DNS_Mgr_Request* dr, struct nb_dns_result* r)
|
||||||
if ( dr->ReqIsTxt() )
|
if ( dr->ReqIsTxt() )
|
||||||
{
|
{
|
||||||
TextMap::iterator it = text_mappings.find(dr->ReqHost());
|
TextMap::iterator it = text_mappings.find(dr->ReqHost());
|
||||||
|
|
||||||
if ( it == text_mappings.end() )
|
if ( it == text_mappings.end() )
|
||||||
text_mappings[dr->ReqHost()] = new_dm;
|
text_mappings[dr->ReqHost()] = new_dm;
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( new_dm->Failed() && prev_dm && prev_dm->Valid() )
|
|
||||||
++keep_prev;
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
prev_dm = it->second;
|
prev_dm = it->second;
|
||||||
it->second = new_dm;
|
it->second = new_dm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( new_dm->Failed() && prev_dm && prev_dm->Valid() )
|
||||||
|
{
|
||||||
|
text_mappings[dr->ReqHost()] = prev_dm;
|
||||||
|
++keep_prev;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue