summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-12-14 21:26:15 +0100
committerLennart Poettering <lennart@poettering.net>2015-12-14 21:28:39 +0100
commitd0ae14ff09fca330d0ae3b41ab15e0d42210967b (patch)
tree24c733f00f6e8734a3dd28eadfdb45c17c8336f9
parente1a9f1a81dd438f972353f1907a99325c51bdfda (diff)
resolved: when serializing NSEC3 windows, don't write more windows than necessary
-rw-r--r--src/resolve/resolved-dns-packet.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c
index 8fc3094b67..c34ecc44f8 100644
--- a/src/resolve/resolved-dns-packet.c
+++ b/src/resolve/resolved-dns-packet.c
@@ -659,15 +659,16 @@ static int dns_packet_append_types(DnsPacket *p, Bitmap *types, size_t *start) {
}
window = n >> 8;
-
entry = n & 255;
bitmaps[entry / 8] |= 1 << (7 - (entry % 8));
}
- r = dns_packet_append_type_window(p, window, entry / 8 + 1, bitmaps, NULL);
- if (r < 0)
- goto fail;
+ if (bitmaps[entry / 8] != 0) {
+ r = dns_packet_append_type_window(p, window, entry / 8 + 1, bitmaps, NULL);
+ if (r < 0)
+ goto fail;
+ }
if (start)
*start = saved_size;