summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-answer.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-30 19:34:50 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-30 19:34:50 +0200
commit57f5ad3149b604d07816da61e6aa7dcf1cc56b64 (patch)
tree5fbc41a68e175c84569203ef64fdcb1b730d6710 /src/resolve/resolved-dns-answer.c
parentfcf57f9cf706ff5be2b5e6d41b2ac48e3e98467b (diff)
resolved: properly set TTL in SOA records
Diffstat (limited to 'src/resolve/resolved-dns-answer.c')
-rw-r--r--src/resolve/resolved-dns-answer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/resolve/resolved-dns-answer.c b/src/resolve/resolved-dns-answer.c
index b6883a3aba..7c4ab18b58 100644
--- a/src/resolve/resolved-dns-answer.c
+++ b/src/resolve/resolved-dns-answer.c
@@ -97,13 +97,15 @@ int dns_answer_add(DnsAnswer *a, DnsResourceRecord *rr) {
return 1;
}
-int dns_answer_add_soa(DnsAnswer *a, const char *name) {
+int dns_answer_add_soa(DnsAnswer *a, const char *name, uint32_t ttl) {
_cleanup_(dns_resource_record_unrefp) DnsResourceRecord *soa = NULL;
soa = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_SOA, name);
if (!soa)
return -ENOMEM;
+ soa->ttl = ttl;
+
soa->soa.mname = strdup(name);
if (!soa->soa.mname)
return -ENOMEM;
@@ -116,7 +118,7 @@ int dns_answer_add_soa(DnsAnswer *a, const char *name) {
soa->soa.refresh = 1;
soa->soa.retry = 1;
soa->soa.expire = 1;
- soa->soa.minimum = 1;
+ soa->soa.minimum = ttl;
return dns_answer_add(a, soa);
}