summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-packet.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-23 00:57:25 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-23 02:00:40 +0200
commit7e8e0422aeb16f2a09a40546c61df753d10029b6 (patch)
treec5fd640ba84c1b3c92367aa4540e90c69c557a0b /src/resolve/resolved-dns-packet.c
parentfaa133f3aa7a18f26563dc5d6b95898cb315c37a (diff)
resolved: implement negative caching
Diffstat (limited to 'src/resolve/resolved-dns-packet.c')
-rw-r--r--src/resolve/resolved-dns-packet.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c
index 527102943a..e5a4a40341 100644
--- a/src/resolve/resolved-dns-packet.c
+++ b/src/resolve/resolved-dns-packet.c
@@ -711,6 +711,34 @@ int dns_packet_read_rr(DnsPacket *p, DnsResourceRecord **ret, size_t *start) {
memcpy(&rr->aaaa.in6_addr, d, sizeof(struct in6_addr));
break;
+ case DNS_TYPE_SOA:
+ r = dns_packet_read_name(p, &rr->soa.mname, NULL);
+ if (r < 0)
+ goto fail;
+
+ r = dns_packet_read_name(p, &rr->soa.rname, NULL);
+ if (r < 0)
+ goto fail;
+
+ r = dns_packet_read_uint32(p, &rr->soa.serial, NULL);
+ if (r < 0)
+ goto fail;
+
+ r = dns_packet_read_uint32(p, &rr->soa.refresh, NULL);
+ if (r < 0)
+ goto fail;
+
+ r = dns_packet_read_uint32(p, &rr->soa.retry, NULL);
+ if (r < 0)
+ goto fail;
+
+ r = dns_packet_read_uint32(p, &rr->soa.expire, NULL);
+ if (r < 0)
+ goto fail;
+
+ r = dns_packet_read_uint32(p, &rr->soa.minimum, NULL);
+ break;
+
default:
r = dns_packet_read(p, rdlength, &d, NULL);
if (r < 0)