From 0d9497bce6aac100d85bfcba3b074ecbb587f1b5 Mon Sep 17 00:00:00 2001 From: "Meredith L. Patterson" Date: Thu, 24 May 2012 13:58:38 +0200 Subject: [PATCH] had qname wrong, fixed it --- examples/dns.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/dns.c b/examples/dns.c index 81afa7c..ec8f712 100644 --- a/examples/dns.c +++ b/examples/dns.c @@ -72,9 +72,12 @@ parser_t* init_parser() { int_range(uint16(), 255, 255), NULL); - const parser_t *dns_question = sequence(length_value(uint8(), uint8()), // QNAME - qtype, // QTYPE - qclass, // QCLASS + const parser_t *dns_question = sequence(sequence(many1(length_value(uint8(), + uint8())), + ch('\x00'), + NULL), // QNAME + qtype, // QTYPE + qclass, // QCLASS NULL); const parser_t *letter = choice(ch_range('a', 'z'),