summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-packet.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-packet.c
parent58ab31d57fdc2b55ebe07be90aea492911b6bad5 (diff)
downloadsystemd-c3ae418821a26005955af8b0e7c7207283213f55.tar.gz
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-packet.c')
-rw-r--r--src/resolve/resolved-dns-packet.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c
index 8231c21450..652970284e 100644
--- a/src/resolve/resolved-dns-packet.c
+++ b/src/resolve/resolved-dns-packet.c
@@ -796,6 +796,7 @@ int dns_packet_truncate_opt(DnsPacket *p) {
int dns_packet_append_rr(DnsPacket *p, const DnsResourceRecord *rr, const DnsAnswerFlags flags, size_t *start, size_t *rdata_start) {
size_t saved_size, rdlength_offset, end, rdlength, rds;
+ uint32_t ttl;
int r;
assert(p);
@@ -807,7 +808,8 @@ int dns_packet_append_rr(DnsPacket *p, const DnsResourceRecord *rr, const DnsAns
if (r < 0)
goto fail;
- r = dns_packet_append_uint32(p, rr->ttl, NULL);
+ ttl = flags & DNS_ANSWER_GOODBYE ? 0 : rr->ttl;
+ r = dns_packet_append_uint32(p, ttl, NULL);
if (r < 0)
goto fail;