From c61dd198461c342563b41382ddb673b13e4c76d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kol=C3=A1rik?= Date: Mon, 25 Mar 2019 14:57:09 +0100 Subject: [PATCH] Fix udpPayloadSize encoding --- index.js | 2 +- test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)