Merge pull request #629 from arurke/bug/set-correct-dns-record-expiration

Set correct DNS record expiration time
This commit is contained in:
George Oikonomou 2018-09-08 09:59:32 +01:00 committed by GitHub
commit dedf033668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1017,7 +1017,8 @@ newdata(void)
namemapptr->state = STATE_DONE;
#if RESOLV_SUPPORTS_RECORD_EXPIRATION
namemapptr->expiration = ans->ttl[1] + (ans->ttl[0] << 8);
namemapptr->expiration = (uint32_t) uip_ntohs(ans->ttl[0]) << 16 |
(uint32_t) uip_ntohs(ans->ttl[1]);
namemapptr->expiration += clock_seconds();
#endif /* RESOLV_SUPPORTS_RECORD_EXPIRATION */