Skip to content

Commit

Permalink
fix: use consistent /dnsaddr code (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Gierth authored and daviddias committed Mar 23, 2018
1 parent 9cae2bd commit 67fef56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ Convert.toString = function convertToString (proto, buf) {
case 132: // sctp
return buf2port(buf)

case 53: // dns
case 54: // dns4
case 55: // dns6
case 56: // dnsaddr
return buf2str(buf)

case 421: // ipfs
Expand All @@ -54,9 +54,9 @@ Convert.toBuffer = function convertToBuffer (proto, str) {
case 132: // sctp
return port2buf(parseInt(str, 10))

case 53: // dns
case 54: // dns4
case 55: // dns6
case 56: // dnsaddr
return str2buf(str)

case 421: // ipfs
Expand Down
2 changes: 1 addition & 1 deletion src/protocols-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ Protocols.table = [
[17, 16, 'udp'],
[33, 16, 'dccp'],
[41, 128, 'ip6'],
[53, V, 'dnsaddr', 'resolvable'],
[54, V, 'dns4', 'resolvable'],
[55, V, 'dns6', 'resolvable'],
[56, V, 'dnsaddr', 'resolvable'],
[132, 16, 'sctp'],
// all of the below use varint for size
[302, 0, 'utp'],
Expand Down

0 comments on commit 67fef56

Please sign in to comment.