From 307832883670a5b367e168d3d794c9b491712c2d Mon Sep 17 00:00:00 2001 From: Calle Dybedahl Date: Thu, 22 May 2014 12:46:34 +0200 Subject: [PATCH] Remember that an OPT pseudo-RR was seen. --- ldns/packet.h | 2 ++ packet.c | 3 ++- wire2host.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ldns/packet.h b/ldns/packet.h index 9dca06f5..2732e94f 100644 --- a/ldns/packet.h +++ b/ldns/packet.h @@ -251,6 +251,8 @@ struct ldns_struct_pkt uint8_t _edns_extended_rcode; /** EDNS Version */ uint8_t _edns_version; + /* OPT pseudo-RR presence flag */ + uint8_t _edns_present; /** Reserved EDNS data bits */ uint16_t _edns_z; /** Arbitrary EDNS rdata */ diff --git a/packet.c b/packet.c index 0ac64c52..7c427831 100644 --- a/packet.c +++ b/packet.c @@ -721,7 +721,8 @@ ldns_pkt_edns(const ldns_pkt *pkt) { return (ldns_pkt_edns_udp_size(pkt) > 0 || ldns_pkt_edns_extended_rcode(pkt) > 0 || ldns_pkt_edns_data(pkt) || - ldns_pkt_edns_do(pkt) + ldns_pkt_edns_do(pkt) || + pkt->_edns_present ); } diff --git a/wire2host.c b/wire2host.c index f305808c..a36fd344 100644 --- a/wire2host.c +++ b/wire2host.c @@ -477,6 +477,7 @@ ldns_wire2pkt(ldns_pkt **packet_p, const uint8_t *wire, size_t max) if(have_edns) ldns_pkt_set_arcount(packet, ldns_pkt_arcount(packet) - have_edns); + packet->_edns_present = have_edns; *packet_p = packet; return status; -- 2.47.3