Socket
Socket
Sign inDemoInstall

dns-packet

Package Overview
Dependencies
Maintainers
2
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dns-packet - npm Package Compare versions

Comparing version 5.2.4 to 5.3.0

17

index.js
'use strict'
const Buffer = require('buffer').Buffer
const types = require('./types')

@@ -8,3 +9,3 @@ const rcodes = require('./rcodes')

const optioncodes = require('./optioncodes')
const ip = require('ip')
const ip = require('@leichtgewicht/ip-codec')

@@ -617,3 +618,3 @@ const QUERY_FLAG = 0

offset += 2
ip.toBuffer(host, buf, offset)
ip.v4.encode(host, buf, offset)
ra.encode.bytes = 6

@@ -629,3 +630,3 @@ return buf

offset += 2
const host = ip.toString(buf, offset, 4)
const host = ip.v4.decode(buf, offset)
ra.decode.bytes = 6

@@ -649,3 +650,3 @@ return host

offset += 2
ip.toBuffer(host, buf, offset)
ip.v6.encode(host, buf, offset)
raaaa.encode.bytes = 18

@@ -661,3 +662,3 @@ return buf

offset += 2
const host = ip.toString(buf, offset, 16)
const host = ip.v6.decode(buf, offset)
raaaa.decode.bytes = 18

@@ -695,4 +696,4 @@ return host

const spl = option.sourcePrefixLength || 0
const fam = option.family || (ip.isV4Format(option.ip) ? 1 : 2)
const ipBuf = ip.toBuffer(option.ip)
const fam = option.family || ip.familyOf(option.ip)
const ipBuf = ip.encode(option.ip, Buffer.alloc)
const ipLen = Math.ceil(spl / 8)

@@ -768,3 +769,3 @@ buf.writeUInt16BE(ipLen + 4, offset)

buf.copy(padded, 0, offset, offset + len - 4)
option.ip = ip.toString(padded)
option.ip = ip.decode(padded)
break

@@ -771,0 +772,0 @@ // case 12: Padding. No decode makes sense.

{
"name": "dns-packet",
"version": "5.2.4",
"version": "5.3.0",
"description": "An abstract-encoding compliant module for encoding / decoding DNS packets",

@@ -20,3 +20,3 @@ "author": "Mathias Buus",

"dependencies": {
"ip": "^1.1.5"
"@leichtgewicht/ip-codec": "^2.0.1"
},

@@ -23,0 +23,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc