summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-scope.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-02-13 20:45:40 +0100
committerLennart Poettering <lennart@poettering.net>2017-02-14 11:13:48 +0100
commitfc0195fabf1505d50271c7579657dacd98ad7904 (patch)
tree49af3cdbff476ae0736bc99706ec054a5c8f699b /src/resolve/resolved-dns-scope.c
parent19fee3ef702ff09cc5ca9531d9e9d985da55aa69 (diff)
resolved: size the mdns announce answer array properly
The array doesn't grow dynamically, hence pick the right size at the moment of allocation. Let's simply multiply the number of addresses of this link by 2, as that's how many RRs we maintain for it.
Diffstat (limited to 'src/resolve/resolved-dns-scope.c')
-rw-r--r--src/resolve/resolved-dns-scope.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c
index ac09192c3a..ffaefbe3f2 100644
--- a/src/resolve/resolved-dns-scope.c
+++ b/src/resolve/resolved-dns-scope.c
@@ -1077,7 +1077,7 @@ int dns_scope_announce(DnsScope *scope, bool goodbye) {
if (scope->protocol != DNS_PROTOCOL_MDNS)
return 0;
- answer = dns_answer_new(4);
+ answer = dns_answer_new(scope->link->n_addresses * 2);
if (!answer)
return log_oom();