From: Vladimír Čunát Date: Thu, 18 Jan 2018 11:50:33 +0000 (+0100) Subject: cache pkt: relax an assertion X-Git-Tag: v2.0.0~6^2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab6a7d4075aac64ae2cccc1509d208ebfc12a2dc;p=thirdparty%2Fknot-resolver.git cache pkt: relax an assertion I _think_ (pkt->parsed != pkt->size) didn't catch all KNOT_EMALF cases. --- diff --git a/lib/cache/entry_pkt.c b/lib/cache/entry_pkt.c index 44a363a83..2491abd07 100644 --- a/lib/cache/entry_pkt.c +++ b/lib/cache/entry_pkt.c @@ -186,8 +186,9 @@ int answer_from_pkt(kr_layer_t *ctx, knot_pkt_t *pkt, uint16_t type, memcpy(pkt->wire, eh->data + 2, pkt_len); pkt->size = pkt_len; int ret = knot_pkt_parse(pkt, 0); - if (ret == KNOT_EFEWDATA) { - return kr_error(ENOENT); /* LATER(opt): avoid stashing such packets */ + if (ret == KNOT_EFEWDATA || ret == KNOT_EMALF) { + return kr_error(ENOENT); + /* LATER(opt): try harder to avoid stashing such packets */ } if (ret != KNOT_EOK) { assert(!ret);