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.
This commit is contained in:
parent
19fee3ef70
commit
fc0195fabf
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue