From: Daniel Salzman Date: Tue, 4 Oct 2022 09:20:21 +0000 (+0200) Subject: proxyv2: slight code reorganization X-Git-Tag: v3.4.dev~343 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7253f8b3b302ecc2830a844ee705665dbde11c2a;p=thirdparty%2Fknot-dns.git proxyv2: slight code reorganization --- diff --git a/src/knot/server/proxyv2.c b/src/knot/server/proxyv2.c index a5212fa4b4..ff92263631 100644 --- a/src/knot/server/proxyv2.c +++ b/src/knot/server/proxyv2.c @@ -55,13 +55,15 @@ int proxyv2_header_strip(knot_pkt_t **query, /* * Re-parse the query message using the data in the - * packet following the PROXY v2 payload. + * packet following the PROXY v2 payload. And replace the original + * query with the decapsulated one. */ knot_pkt_t *q = knot_pkt_new(pkt + offset, pkt_len - offset, &(*query)->mm); - ret = knot_pkt_parse(q, 0); - + if (q == NULL) { + return KNOT_ENOMEM; + } knot_pkt_free(*query); *query = q; - return ret; + return knot_pkt_parse(q, 0); }