Commit d0ca8faf authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

make sure error responses are built from the scratch


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1341 e5f2f494-b856-4b98-b285-d166d9295462
parent 01853447
......@@ -93,15 +93,33 @@ AuthSrv::~AuthSrv() {
delete impl_;
}
static void
namespace {
void
makeErrorMessage(Message& message, MessageRenderer& renderer,
const Rcode& rcode)
{
message.makeResponse();
// extract the parameters that should be kept.
// XXX: with the current implementation, it's not easy to set EDNS0
// depending on whether the query had it. So we'll simply omit it.
const qid_t qid = message.getQid();
const bool rd = message.getHeaderFlag(MessageFlag::RD());
const bool cd = message.getHeaderFlag(MessageFlag::CD());
const Opcode& opcode = message.getOpcode();
message.clear(Message::RENDER);
message.setQid(qid);
message.setOpcode(opcode);
message.setHeaderFlag(MessageFlag::QR());
if (rd) {
message.setHeaderFlag(MessageFlag::RD());
}
if (cd) {
message.setHeaderFlag(MessageFlag::CD());
}
message.setRcode(rcode);
message.setUDPSize(4096); // XXX: hardcoding
message.toWire(renderer);
}
}
int
AuthSrv::processMessage(InputBuffer& request_buffer,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment