summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-packet.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-07-16 14:06:11 +0200
committerTom Gundersen <teg@jklm.no>2015-07-16 14:11:12 +0200
commitcb57dd41595adddb08095298bb1ed258c8ea4877 (patch)
tree6478f1aa84a405218ab50bc3508b1c39d0de20e2 /src/resolve/resolved-dns-packet.c
parent443a55981388f519fb6528a8ee042f9e69079b68 (diff)
bitmap: use external iterator
Reuse the Iterator object from hashmap.h and expose a similar API. This allows us to do { Iterator i; unsigned n; BITMAP_FOREACH(n, b, i) { Iterator j; unsigned m; BITMAP_FOREACH(m, b, j) { ... } } } without getting confused. Requested by David.
Diffstat (limited to 'src/resolve/resolved-dns-packet.c')
-rw-r--r--src/resolve/resolved-dns-packet.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c
index e44d3926d9..b1cde4ab35 100644
--- a/src/resolve/resolved-dns-packet.c
+++ b/src/resolve/resolved-dns-packet.c
@@ -536,6 +536,7 @@ fail:
}
static int dns_packet_append_types(DnsPacket *p, Bitmap *types, size_t *start) {
+ Iterator i;
uint8_t window = 0;
uint8_t len = 0;
uint8_t bitmaps[32] = {};
@@ -548,7 +549,7 @@ static int dns_packet_append_types(DnsPacket *p, Bitmap *types, size_t *start) {
saved_size = p->size;
- BITMAP_FOREACH(n, types) {
+ BITMAP_FOREACH(n, types, i) {
uint8_t entry;
assert(n <= 0xffff);