Skip to content
Snippets Groups Projects
Commit 4b3817ac authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

Do not count EDNS0 minsize calculation if not requested.

parent e5c41720
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,11 @@ static void pkt_wire_set(knot_pkt_t *pkt, void *wire, uint16_t len)
static uint16_t pkt_remaining(knot_pkt_t *pkt)
{
return pkt->max_size - pkt->size - pkt->opt_rr.size - pkt->tsig_size;
uint16_t remaining = pkt->max_size - pkt->size - pkt->tsig_size;
if (knot_pkt_have_edns(pkt)) {
remaining -= pkt->opt_rr.size;
}
return remaining;
}
/*! \brief Return RR count for given section (from wire xxCOUNT in header). */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment