diff --git a/index.js b/index.js index 034a0b4..b6a52c6 100644 --- a/index.js +++ b/index.js @@ -1316,7 +1316,7 @@ answer.encode = function (a, buf, offset) { if (a.name !== '.') { 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.ednsVersion || 0, offset + 5) buf.writeUInt16BE(a.flags || 0, offset + 6) diff --git a/test.js b/test.js index 6a8d4d8..adf4757 100644 --- a/test.js +++ b/test.js @@ -340,7 +340,7 @@ tape('opt', function (t) { additionals: [{ type: 'OPT', name: '.', - udpPayloadSize: 4096 + udpPayloadSize: 1024 }] } testEncoder(t, packet, val)