summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-packet.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-08-25 18:59:40 +0200
committerLennart Poettering <lennart@poettering.net>2015-08-25 19:04:04 +0200
commitf0258e473667f44f4656dde49597b2badb9f598a (patch)
tree39f6a33757ae174631dc6d9c38f43070b49d3cd9 /src/resolve/resolved-dns-packet.h
parent069360a66a227606f4cf5e6ec05de61cd6ade76e (diff)
resolved: add comments to DNS_PACKET_MAKE_FLAGS() clarifying DNS vs LLMNR
Some flags are defined differently on unicast DNS and LLMNR, let's document this in the DNS_PACKET_MAKE_FLAGS() macro.
Diffstat (limited to 'src/resolve/resolved-dns-packet.h')
-rw-r--r--src/resolve/resolved-dns-packet.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/resolve/resolved-dns-packet.h b/src/resolve/resolved-dns-packet.h
index 8a72b898da..5628e579ad 100644
--- a/src/resolve/resolved-dns-packet.h
+++ b/src/resolve/resolved-dns-packet.h
@@ -121,15 +121,15 @@ static inline uint8_t* DNS_PACKET_DATA(DnsPacket *p) {
#define DNS_PACKET_ARCOUNT(p) be16toh(DNS_PACKET_HEADER(p)->arcount)
#define DNS_PACKET_MAKE_FLAGS(qr, opcode, aa, tc, rd, ra, ad, cd, rcode) \
- (((uint16_t) !!qr << 15) | \
- ((uint16_t) (opcode & 15) << 11) | \
- ((uint16_t) !!aa << 10) | \
- ((uint16_t) !!tc << 9) | \
- ((uint16_t) !!rd << 8) | \
- ((uint16_t) !!ra << 7) | \
- ((uint16_t) !!ad << 5) | \
- ((uint16_t) !!cd << 4) | \
- ((uint16_t) (rcode & 15)))
+ (((uint16_t) !!(qr) << 15) | \
+ ((uint16_t) ((opcode) & 15) << 11) | \
+ ((uint16_t) !!(aa) << 10) | /* on LLMNR: c */ \
+ ((uint16_t) !!(tc) << 9) | \
+ ((uint16_t) !!(rd) << 8) | /* on LLMNR: t */ \
+ ((uint16_t) !!(ra) << 7) | \
+ ((uint16_t) !!(ad) << 5) | \
+ ((uint16_t) !!(cd) << 4) | \
+ ((uint16_t) ((rcode) & 15)))
static inline unsigned DNS_PACKET_RRCOUNT(DnsPacket *p) {
return