terminate MX label with null

This commit is contained in:
AJ ONeal 2017-10-19 12:15:45 -06:00
parent 908fd5314c
commit c6715ee6bf
1 changed files with 5 additions and 2 deletions

View File

@ -22,7 +22,7 @@ exports.DNS_PACKER_TYPE_MX = function (ab, dv, total, record) {
// 16-bit priority and a sequence of labels as the exchange // 16-bit priority and a sequence of labels as the exchange
record.exchange.split('.').forEach(function (label) { record.exchange.split('.').forEach(function (label) {
mxLen += 1 + label.length; mxLen += 1 + label.length;
dv.setUint8(total, label.length, false); dv.setUint8(total, label.length, false);
total += 1; total += 1;
@ -31,10 +31,13 @@ exports.DNS_PACKER_TYPE_MX = function (ab, dv, total, record) {
total += 1; total += 1;
}); });
}); });
dv.setUint8(total, 0, false);
total += 1;
mxLen += 1;
// RDLENGTH // RDLENGTH
dv.setUint16(rdLenIndex, mxLen, false); dv.setUint16(rdLenIndex, mxLen, false);
return total; return total;
}; };