summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-bus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-16 18:03:46 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-16 18:03:46 +0200
commit3cb10d3a0b1b6a7c44f307f2abb5215104e16941 (patch)
treeb6e20ffbbbb982bdff0766e69304866a5004c72e /src/resolve/resolved-bus.c
parentacbc5016027950efd543e0b054e6370a8a4e17f9 (diff)
dns-domain: introduce macros for accessing all DNS header fields
Diffstat (limited to 'src/resolve/resolved-bus.c')
-rw-r--r--src/resolve/resolved-bus.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c
index e73bdacbbf..02e971dbf3 100644
--- a/src/resolve/resolved-bus.c
+++ b/src/resolve/resolved-bus.c
@@ -86,10 +86,9 @@ static void bus_method_resolve_hostname_complete(DnsQuery *q) {
if (r < 0)
goto finish;
- n = be16toh(DNS_PACKET_HEADER(q->packet)->ancount) +
- be16toh(DNS_PACKET_HEADER(q->packet)->nscount) +
- be16toh(DNS_PACKET_HEADER(q->packet)->arcount);
-
+ n = DNS_PACKET_ANCOUNT(q->packet) +
+ DNS_PACKET_NSCOUNT(q->packet) +
+ DNS_PACKET_ARCOUNT(q->packet);
for (i = 0; i < n; i++) {
_cleanup_(dns_resource_record_unrefp) DnsResourceRecord *rr = NULL;
@@ -292,10 +291,9 @@ static void bus_method_resolve_address_complete(DnsQuery *q) {
if (r < 0)
goto finish;
- n = be16toh(DNS_PACKET_HEADER(q->packet)->ancount) +
- be16toh(DNS_PACKET_HEADER(q->packet)->nscount) +
- be16toh(DNS_PACKET_HEADER(q->packet)->arcount);
-
+ n = DNS_PACKET_ANCOUNT(q->packet) +
+ DNS_PACKET_NSCOUNT(q->packet) +
+ DNS_PACKET_ARCOUNT(q->packet);
for (i = 0; i < n; i++) {
_cleanup_(dns_resource_record_unrefp) DnsResourceRecord *rr = NULL;