Skip to content

Commit 17323a6

Browse files
committed
added IPv6 normalization
1 parent 921b873 commit 17323a6

File tree

2 files changed

+38
-20
lines changed

2 files changed

+38
-20
lines changed

encode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2012 Iris Couch, all rights reserved.
22
//
33
// Encode DNS messages
4-
4+
const ip6 = require('ip6');
55
var util = require('util')
66

77
var constants = require('./constants')
@@ -128,7 +128,7 @@ State.prototype.record = function(section_name, record) {
128128
rdata = [ +match[1], +match[2], +match[3], +match[4] ]
129129
break
130130
case 'IN AAAA':
131-
rdata = (record.data || '').split(/:/)
131+
rdata = (ip6.normalize(record.data) || '').split(/:/)
132132
if(rdata.length != 8)
133133
throw new Error('Bad '+record.type+' record data: ' + JSON.stringify(record))
134134
rdata = rdata.map(pair_to_buf)

package.json

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
1-
{ "name": "dnsd"
2-
, "description": "Dynamic authoritative name server for Iris services"
3-
4-
, "keywords": [ "dns", "bind", "dnsd", "iris" ]
5-
, "version": "0.9.6"
6-
, "author": "Jason Smith <jason.h.smith@gmail.com>"
7-
, "repository": { "type":"git", "url":"https://github.com/jhs/dnsd" }
8-
, "licenses": [{ "type": "Apache 2.0", "url": "https://github.com/jhs/dnsd/blob/master/LICENSE" }]
9-
10-
, "engines": { "node": ">= 0.8" }
11-
, "main": "./named.js"
12-
13-
, "dependencies": { "optimist": "~0.3.4"
14-
, "defaultable": "~0.7.2"
15-
}
16-
, "devDependencies": { "tap": "~0.2.5"
17-
}
18-
, "scripts": { "test": "tap test/*.js" }
1+
{
2+
"name": "dnsd",
3+
"description": "Dynamic authoritative name server for Iris services",
4+
"keywords": [
5+
"dns",
6+
"bind",
7+
"dnsd",
8+
"iris"
9+
],
10+
"version": "0.9.6",
11+
"author": "Jason Smith <jason.h.smith@gmail.com>",
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/jhs/dnsd"
15+
},
16+
"licenses": [
17+
{
18+
"type": "Apache 2.0",
19+
"url": "https://github.com/jhs/dnsd/blob/master/LICENSE"
20+
}
21+
],
22+
"engines": {
23+
"node": ">= 0.8"
24+
},
25+
"main": "./named.js",
26+
"dependencies": {
27+
"defaultable": "~0.7.2",
28+
"ip6": "^0.1.5",
29+
"optimist": "~0.3.4"
30+
},
31+
"devDependencies": {
32+
"tap": "~0.2.5"
33+
},
34+
"scripts": {
35+
"test": "tap test/*.js"
36+
}
1937
}

0 commit comments

Comments
 (0)