terminate labels with null
This commit is contained in:
parent
c6715ee6bf
commit
b2dd53dcb1
|
@ -15,20 +15,22 @@ exports.DNS_PACKER_TYPE_CNAME = function (ab, dv, total, record) {
|
|||
// RDATA
|
||||
// a sequence of labels
|
||||
record.data.split('.').forEach(function (label) {
|
||||
cnameLen += 1 + label.length;
|
||||
|
||||
dv.setUint8(total, label.length, false);
|
||||
total += 1;
|
||||
cnameLen += 1 + label.length;
|
||||
|
||||
label.split('').forEach(function (ch) {
|
||||
dv.setUint8(total, ch.charCodeAt(0), false);
|
||||
dv.setUint8(total, label.length, false);
|
||||
total += 1;
|
||||
|
||||
label.split('').forEach(function (ch) {
|
||||
dv.setUint8(total, ch.charCodeAt(0), false);
|
||||
total += 1;
|
||||
});
|
||||
});
|
||||
dv.setUint8(total, 0x00, false);
|
||||
total += 1;
|
||||
|
||||
// RDLENGTH
|
||||
dv.setUint16(rdLenIndex, record.data.length + 1, false);
|
||||
|
||||
dv.setUint16(rdLenIndex, record.data.length + 2, false);
|
||||
|
||||
return total;
|
||||
};
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ exports.DNS_PACKER_TYPE_MX = function (ab, dv, total, record) {
|
|||
total += 1;
|
||||
});
|
||||
});
|
||||
dv.setUint8(total, 0, false);
|
||||
dv.setUint8(total, 0x00, false);
|
||||
total += 1;
|
||||
mxLen += 1;
|
||||
|
||||
|
|
|
@ -59,6 +59,10 @@ exports.DNS_PACKER_TYPE_SRV = function (ab, dv, total, record) {
|
|||
});
|
||||
});
|
||||
|
||||
dv.setUint8(total, 0x00, false);
|
||||
total += 1;
|
||||
srvLen += 1;
|
||||
|
||||
// RDLENGTH
|
||||
|
||||
dv.setUint16(rdLenIndex, srvLen, false);
|
||||
|
|
Loading…
Reference in New Issue