From 17323a6505bc6763e073559e8fba941888d94cec Mon Sep 17 00:00:00 2001 From: Eugene Hauptmann Date: Wed, 10 May 2017 07:54:55 -0700 Subject: [PATCH 1/2] added IPv6 normalization --- encode.js | 4 ++-- package.json | 54 ++++++++++++++++++++++++++++++++++------------------ 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/encode.js b/encode.js index d0aa06f..d8637b8 100644 --- a/encode.js +++ b/encode.js @@ -1,7 +1,7 @@ // Copyright 2012 Iris Couch, all rights reserved. // // Encode DNS messages - +const ip6 = require('ip6'); var util = require('util') var constants = require('./constants') @@ -128,7 +128,7 @@ State.prototype.record = function(section_name, record) { rdata = [ +match[1], +match[2], +match[3], +match[4] ] break case 'IN AAAA': - rdata = (record.data || '').split(/:/) + rdata = (ip6.normalize(record.data) || '').split(/:/) if(rdata.length != 8) throw new Error('Bad '+record.type+' record data: ' + JSON.stringify(record)) rdata = rdata.map(pair_to_buf) diff --git a/package.json b/package.json index a5179c7..fae1266 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,37 @@ -{ "name": "dnsd" -, "description": "Dynamic authoritative name server for Iris services" - -, "keywords": [ "dns", "bind", "dnsd", "iris" ] -, "version": "0.9.6" -, "author": "Jason Smith " -, "repository": { "type":"git", "url":"https://github.com/jhs/dnsd" } -, "licenses": [{ "type": "Apache 2.0", "url": "https://github.com/jhs/dnsd/blob/master/LICENSE" }] - -, "engines": { "node": ">= 0.8" } -, "main": "./named.js" - -, "dependencies": { "optimist": "~0.3.4" - , "defaultable": "~0.7.2" - } -, "devDependencies": { "tap": "~0.2.5" - } -, "scripts": { "test": "tap test/*.js" } +{ + "name": "dnsd", + "description": "Dynamic authoritative name server for Iris services", + "keywords": [ + "dns", + "bind", + "dnsd", + "iris" + ], + "version": "0.9.6", + "author": "Jason Smith ", + "repository": { + "type": "git", + "url": "https://github.com/jhs/dnsd" + }, + "licenses": [ + { + "type": "Apache 2.0", + "url": "https://github.com/jhs/dnsd/blob/master/LICENSE" + } + ], + "engines": { + "node": ">= 0.8" + }, + "main": "./named.js", + "dependencies": { + "defaultable": "~0.7.2", + "ip6": "^0.1.5", + "optimist": "~0.3.4" + }, + "devDependencies": { + "tap": "~0.2.5" + }, + "scripts": { + "test": "tap test/*.js" + } } From 2e3218cd3503b7c52d16c4c954968b76dbe96524 Mon Sep 17 00:00:00 2001 From: Eugene Hauptmann Date: Wed, 10 May 2017 07:55:21 -0700 Subject: [PATCH 2/2] bumped version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fae1266..e2c560a 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "dnsd", "iris" ], - "version": "0.9.6", + "version": "0.9.7", "author": "Jason Smith ", "repository": { "type": "git",