diff options
author | Daniel Mack <github@zonque.org> | 2015-08-25 23:47:30 +0200 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-08-25 23:47:30 +0200 |
commit | 4ece412faf5c3a4482a174e6c727c8cba63d97b3 (patch) | |
tree | b63a4f878ddf25e856c299cfa233fa54e6d6c6ff /src/resolve/resolved-dns-packet.c | |
parent | 33c1c9745ccc478c8eda72f8bae76945487076ae (diff) | |
parent | f0258e473667f44f4656dde49597b2badb9f598a (diff) |
Merge pull request #1034 from poettering/resolved-fixes-2
various resolved fixes
Diffstat (limited to 'src/resolve/resolved-dns-packet.c')
-rw-r--r-- | src/resolve/resolved-dns-packet.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c index 784d949cce..bebd1ee4a6 100644 --- a/src/resolve/resolved-dns-packet.c +++ b/src/resolve/resolved-dns-packet.c @@ -64,7 +64,7 @@ int dns_packet_new(DnsPacket **ret, DnsProtocol protocol, size_t mtu) { int dns_packet_new_query(DnsPacket **ret, DnsProtocol protocol, size_t mtu) { DnsPacket *p; DnsPacketHeader *h; - int r, rd; + int r; assert(ret); @@ -74,27 +74,26 @@ int dns_packet_new_query(DnsPacket **ret, DnsProtocol protocol, size_t mtu) { h = DNS_PACKET_HEADER(p); - switch (protocol) { - case DNS_PROTOCOL_LLMNR: - /* no recursion for link-local resolving protocols */ - rd = 0; - break; - - default: - /* ask for recursion */ - rd = 1; - break; - } - - h->flags = htobe16(DNS_PACKET_MAKE_FLAGS(0 /* qr */, - 0 /* opcode */, - 0 /* aa */, - 0 /* tc */, - rd /* rd */, - 0 /* ra */, - 0 /* ad */, - 0 /* cd */, - 0 /* rcode */)); + if (protocol == DNS_PROTOCOL_LLMNR) + h->flags = htobe16(DNS_PACKET_MAKE_FLAGS(0 /* qr */, + 0 /* opcode */, + 0 /* c */, + 0 /* tc */, + 0 /* t */, + 0 /* ra */, + 0 /* ad */, + 0 /* cd */, + 0 /* rcode */)); + else + h->flags = htobe16(DNS_PACKET_MAKE_FLAGS(0 /* qr */, + 0 /* opcode */, + 0 /* aa */, + 0 /* tc */, + 1 /* rd (ask for recursion) */, + 0 /* ra */, + 0 /* ad */, + 0 /* cd */, + 0 /* rcode */)); *ret = p; return 0; |