only add compression pointer length once
This commit is contained in:
parent
8148e25d18
commit
7f673f6fbf
|
@ -106,9 +106,6 @@ pdns.unpack = function (ab) {
|
||||||
q.className = classes[q.class];
|
q.className = classes[q.class];
|
||||||
q.typeName = types[q.type];
|
q.typeName = types[q.type];
|
||||||
|
|
||||||
// console.log('*********************');
|
|
||||||
// console.log(q.typeName);
|
|
||||||
|
|
||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +126,7 @@ pdns.unpack = function (ab) {
|
||||||
//, rdata: 0
|
//, rdata: 0
|
||||||
, rdlength: 0
|
, rdlength: 0
|
||||||
});
|
});
|
||||||
//console.log('unpackAnswer QNAME:');
|
//console.log('unpackAnswer [Q]NAME:');
|
||||||
//console.log(q);
|
//console.log(q);
|
||||||
total += q.byteLength;
|
total += q.byteLength;
|
||||||
q.className = classes[q.class];
|
q.className = classes[q.class];
|
||||||
|
@ -171,6 +168,7 @@ pdns.unpack = function (ab) {
|
||||||
|
|
||||||
total += q.rdlength;
|
total += q.rdlength;
|
||||||
q.byteLength = total - ototal;
|
q.byteLength = total - ototal;
|
||||||
|
|
||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,10 @@ exports.DNS_UNPACK_LABELS = function (ui8, ptr, q) {
|
||||||
|
|
||||||
// we're not coming back!
|
// we're not coming back!
|
||||||
ptr = cpptr;
|
ptr = cpptr;
|
||||||
q.cpcount += 1;
|
if (!q.cpcount) {
|
||||||
q.byteLength += 2; // cp and len
|
q.byteLength += 2; // cp and len
|
||||||
|
}
|
||||||
|
q.cpcount += 1;
|
||||||
|
|
||||||
// recursion
|
// recursion
|
||||||
return exports.DNS_UNPACK_LABELS(ui8, ptr, q);
|
return exports.DNS_UNPACK_LABELS(ui8, ptr, q);
|
||||||
|
|
Loading…
Reference in New Issue