const uint16_t messageLen = getDNSPacketLength(message, this->len);
const uint16_t tailLen = tail.size();
if (tailLen > (this->size - messageLen)) {
+ vinfolog("Trailing data update failed, the new trailing data size was %d, the existing message length was %d, packet size was %d and buffer size %d", tail.size(), messageLen, this->len, this->size);
return false;
}
/* Update length and copy data from the Lua string. */
this->len = messageLen + tailLen;
- if(tailLen > 0) {
+ if (tailLen > 0) {
tail.copy(message + messageLen, tailLen);
}
return true;
try:
request = dns.message.from_wire(data, ignore_trailing=ignoreTrailing)
except dns.message.TrailingJunk as e:
+ print('trailing data exception in UDPResponder')
if trailingDataResponse is False or forceRcode is True:
raise
print("UDP query with trailing data, synthesizing response")
# responders allow trailing data and we don't want
# to mix things up.
_testServerPort = 5360
+ _verboseMode = True
_config_template = """
newServer{address="127.0.0.1:%s"}
self.assertEquals(receivedResponse, expectedResponse)
class TestTrailingDataToDnsdist(DNSDistTest):
+ _verboseMode = True
_config_template = """
newServer{address="127.0.0.1:%s"}
function removeTrailingData(dq)
local success = dq:setTrailingData("")
if not success then
+ print("Trailing removal failed")
return DNSAction.ServFail, ""
end
return DNSAction.None, ""