summaryrefslogtreecommitdiff
path: root/Userland/Services/LookupServer/DNSAnswer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Services/LookupServer/DNSAnswer.cpp')
-rw-r--r--Userland/Services/LookupServer/DNSAnswer.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/Userland/Services/LookupServer/DNSAnswer.cpp b/Userland/Services/LookupServer/DNSAnswer.cpp
index ed1c3bb126..b4c9e8fc9a 100644
--- a/Userland/Services/LookupServer/DNSAnswer.cpp
+++ b/Userland/Services/LookupServer/DNSAnswer.cpp
@@ -18,15 +18,12 @@ DNSAnswer::DNSAnswer(const DNSName& name, DNSRecordType type, DNSRecordClass cla
, m_record_data(record_data)
, m_mdns_cache_flush(mdns_cache_flush)
{
- auto now = time(nullptr);
- m_expiration_time = now + m_ttl;
- if (m_expiration_time < now)
- m_expiration_time = 0;
+ time(&m_received_time);
}
bool DNSAnswer::has_expired() const
{
- return time(nullptr) >= m_expiration_time;
+ return time(nullptr) >= m_received_time + m_ttl;
}
}