We need to return false when it was not possible to set the option,
and to properly set the value indicating that we added an EDNS OPT
RR if needed.
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
return true;
}
- if (generateOptRR(optRData, buf, maximumSize, dnsdist::configuration::s_EdnsUDPPayloadSize, 0, false)) {
- dnsdist::PacketMangling::editDNSHeaderFromPacket(buf, [](dnsheader& header) {
- header.arcount = htons(1);
- return true;
- });
+ if (!generateOptRR(optRData, buf, maximumSize, dnsdist::configuration::s_EdnsUDPPayloadSize, 0, false)) {
+ return false;
}
+ dnsdist::PacketMangling::editDNSHeaderFromPacket(buf, [](dnsheader& header) {
+ header.arcount = htons(1);
+ return true;
+ });
+ ednsAdded = true;
+
return true;
}