Fix udpPayloadSize encoding

This commit is contained in:
Martin Kolárik 2019-03-25 14:57:09 +01:00 committed by Mathias Buus
parent 77eadae3c3
commit c61dd19846
2 changed files with 2 additions and 2 deletions

View File

@ -1316,7 +1316,7 @@ answer.encode = function (a, buf, offset) {
if (a.name !== '.') { if (a.name !== '.') {
throw new Error('OPT name must be root.') throw new Error('OPT name must be root.')
} }
buf.writeUInt16BE(a.updPayloadSize || 4096, offset + 2) buf.writeUInt16BE(a.udpPayloadSize || 4096, offset + 2)
buf.writeUInt8(a.extendedRcode || 0, offset + 4) buf.writeUInt8(a.extendedRcode || 0, offset + 4)
buf.writeUInt8(a.ednsVersion || 0, offset + 5) buf.writeUInt8(a.ednsVersion || 0, offset + 5)
buf.writeUInt16BE(a.flags || 0, offset + 6) buf.writeUInt16BE(a.flags || 0, offset + 6)

View File

@ -340,7 +340,7 @@ tape('opt', function (t) {
additionals: [{ additionals: [{
type: 'OPT', type: 'OPT',
name: '.', name: '.',
udpPayloadSize: 4096 udpPayloadSize: 1024
}] }]
} }
testEncoder(t, packet, val) testEncoder(t, packet, val)