From: Marek VavruĊĦa Date: Tue, 3 Apr 2018 21:04:32 +0000 (-0700) Subject: lib/resolve: don't append EDNS to garbage packets X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b1513a5d8fa659fb6ae88a3dce182ad27d9bb6b;p=thirdparty%2Fknot-resolver.git lib/resolve: don't append EDNS to garbage packets The current handler will try to construct the compression table starting with query name in question. If there's no query name, it's going to construct it with garbage bytes. --- diff --git a/lib/resolve.c b/lib/resolve.c index d18a9284a..af1f317f2 100644 --- a/lib/resolve.c +++ b/lib/resolve.c @@ -383,7 +383,8 @@ static int ns_resolve_addr(struct kr_query *qry, struct kr_request *param) static int edns_put(knot_pkt_t *pkt) { - if (!pkt->opt_rr) { + /* Don't append EDNS to garbage packets */ + if (!pkt->opt_rr || knot_pkt_qname(pkt) == NULL) { return kr_ok(); } /* Reclaim reserved size. */