diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2024-04-25 16:59:01 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2024-04-25 16:59:01 +0000 |
commit | b33a7fccfe0fee17bba800fb0e112c3a6519b090 (patch) | |
tree | 354be23d46d35bae2f69d6c1bde916b9d214cd38 | |
parent | 9b375965d45e69fa2b7c27c4d1da66f26d76cb14 (diff) | |
download | shibari-b33a7fccfe0fee17bba800fb0e112c3a6519b090.tar.gz shibari-b33a7fccfe0fee17bba800fb0e112c3a6519b090.tar.xz shibari-b33a7fccfe0fee17bba800fb0e112c3a6519b090.zip |
bugfix: wildcard management
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r-- | src/server/shibari_packet_tdb_answer_query.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/shibari_packet_tdb_answer_query.c b/src/server/shibari_packet_tdb_answer_query.c index 2627efb..d9e9474 100644 --- a/src/server/shibari_packet_tdb_answer_query.c +++ b/src/server/shibari_packet_tdb_answer_query.c @@ -29,7 +29,6 @@ static unsigned int childzone (shibari_packet *pkt, cdb const *tdb, s6dns_domain unsigned int shibari_packet_tdb_answer_query (shibari_packet *pkt, cdb const *tdb, s6dns_message_header_t const *qhdr, s6dns_domain_t const *q, uint16_t qtype, char const *loc, tain const *stamp) { unsigned int rcode = 0 ; - cdb_find_state state = CDB_FIND_STATE_ZERO ; uint32_t flagyxdomain = 0 ; int nplen, zplen ; uint16_t gluetype = 0 ; @@ -51,13 +50,14 @@ unsigned int shibari_packet_tdb_answer_query (shibari_packet *pkt, cdb const *td while (wildpos <= zplen) { + cdb_find_state state = CDB_FIND_STATE_ZERO ; for (;;) { shibari_tdb_entry entry ; - int r = shibari_tdb_read_entry(tdb, &state, &entry, q->s + wildpos, q->len + wildpos, qtype, !!wildpos, loc, stamp, &flagyxdomain) ; + int r = shibari_tdb_read_entry(tdb, &state, &entry, q->s + wildpos, q->len - wildpos, qtype, !!wildpos, loc, stamp, &flagyxdomain) ; if (r == -1) return 2 ; if (!r) break ; - if (!shibari_packet_add_rr(pkt, &entry, 0, 0, 2)) + if (!shibari_packet_add_rr(pkt, &entry, 0, wildpos, 2)) { pkt->hdr.tc = 1 ; return 0 ; @@ -72,7 +72,7 @@ unsigned int shibari_packet_tdb_answer_query (shibari_packet *pkt, cdb const *td default : break ; } } - if (pkt->hdr.counts.an) break ; + if (pkt->hdr.counts.an || flagyxdomain) break ; wildpos += 1 + q->s[wildpos] ; } |