summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-packet.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2015-12-09 12:01:08 +0100
committerDaniel Mack <daniel@zonque.org>2015-12-10 10:20:54 +0100
commit9c491563837983385bf9fa244590e76e142f4fa3 (patch)
tree6f356f7750cb900957e475264697a2612507b513 /src/resolve/resolved-dns-packet.c
parentdbfbb6e776d613cb9be76d13de076d08450c9d29 (diff)
resolved: add support for linked packets
For mDNS, we need to support the TC bit in case the list of known answers exceed the maximum packet size. For this, add a 'more' pointer to DnsPacket for an additional packet. When a packet is unref'ed, the ->more packet is also unrefed, so it sufficient to only keep track of the 1st packet in a chain.
Diffstat (limited to 'src/resolve/resolved-dns-packet.c')
-rw-r--r--src/resolve/resolved-dns-packet.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c
index e5de5a1cd6..f753b3522f 100644
--- a/src/resolve/resolved-dns-packet.c
+++ b/src/resolve/resolved-dns-packet.c
@@ -170,6 +170,9 @@ DnsPacket *dns_packet_unref(DnsPacket *p) {
assert(p->n_ref > 0);
+ if (p->more)
+ dns_packet_unref(p->more);
+
if (p->n_ref == 1)
dns_packet_free(p);
else