Commit 5c8c0e56 authored by Marek Vavrusa's avatar Marek Vavrusa

Multipacket transfers may not carry question section, allow that.

parent 7a80a524
......@@ -3158,6 +3158,12 @@ int knot_ns_parse_packet(const uint8_t *query_wire, size_t qsize,
return KNOT_RCODE_FORMERR;
}
// 2) queries need to have 1 question
if (knot_wire_get_qdcount(packet->wireformat) != 1) {
dbg_ns("Missing question section, FORMERR\n");
return KNOT_RCODE_FORMERR;
}
dbg_ns_verb("Parsed packet header and Question:\n");
knot_packet_dump(packet);
......
......@@ -483,8 +483,8 @@ int knot_packet_parse_from_wire(knot_packet_t *packet,
if (qdcount == 1) {
if ((err = knot_packet_parse_question(packet)) != KNOT_EOK)
return err;
} else {
dbg_packet("QDCOUNT != 1, FORMERR.\n");
} else if (qdcount > 1) {
dbg_packet("QDCOUNT > 1, FORMERR.\n");
return KNOT_EMALF;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment