summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-scope.c
diff options
context:
space:
mode:
authorDmitry Rozhkov <dmitry.rozhkov@linux.intel.com>2016-12-02 15:56:27 +0200
committerDmitry Rozhkov <dmitry.rozhkov@linux.intel.com>2017-01-19 11:51:21 +0200
commitc3ae418821a26005955af8b0e7c7207283213f55 (patch)
treec67e8f79b98e549d5afeb85847c3ec3a158027a5 /src/resolve/resolved-dns-scope.c
parent58ab31d57fdc2b55ebe07be90aea492911b6bad5 (diff)
resolved: implement sending goodbye mDNS packet
resolved: remove unneeded braces Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
Diffstat (limited to 'src/resolve/resolved-dns-scope.c')
-rw-r--r--src/resolve/resolved-dns-scope.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c
index b47cb79795..750409eebf 100644
--- a/src/resolve/resolved-dns-scope.c
+++ b/src/resolve/resolved-dns-scope.c
@@ -1068,11 +1068,11 @@ static int on_announcement_timeout(sd_event_source *s, usec_t usec, void *userda
scope->announce_event_source = sd_event_source_unref(scope->announce_event_source);
- dns_scope_announce(scope);
+ dns_scope_announce(scope, false);
return 0;
}
-void dns_scope_announce(DnsScope *scope) {
+void dns_scope_announce(DnsScope *scope, bool goodbye) {
_cleanup_(dns_answer_unrefp) DnsAnswer *answer = NULL;
_cleanup_(dns_packet_unrefp) DnsPacket *p = NULL;
LinkAddress *a;
@@ -1086,12 +1086,12 @@ void dns_scope_announce(DnsScope *scope) {
answer = dns_answer_new(4);
LIST_FOREACH(addresses, a, scope->link->addresses) {
- r = dns_answer_add(answer, a->mdns_address_rr, 0, DNS_ANSWER_CACHE_FLUSH);
+ r = dns_answer_add(answer, a->mdns_address_rr, 0, goodbye ? DNS_ANSWER_GOODBYE : DNS_ANSWER_CACHE_FLUSH);
if (r < 0) {
log_debug_errno(r, "Failed to add address RR to answer: %m");
return;
}
- r = dns_answer_add(answer, a->mdns_ptr_rr, 0, DNS_ANSWER_CACHE_FLUSH);
+ r = dns_answer_add(answer, a->mdns_ptr_rr, 0, goodbye ? DNS_ANSWER_GOODBYE : DNS_ANSWER_CACHE_FLUSH);
if (r < 0) {
log_debug_errno(r, "Failed to add PTR RR to answer: %m");
return;