From 7a417a591d35a6d001fa82000dc97fc60b216d67 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 11 Dec 2014 16:11:12 +0100 Subject: [PATCH] parseUdpRequest(): fix params.ip --- lib/parse_udp.js | 3 ++- server.js | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/parse_udp.js b/lib/parse_udp.js index 411d5b2..2c1ee8e 100644 --- a/lib/parse_udp.js +++ b/lib/parse_udp.js @@ -1,4 +1,5 @@ var bufferEqual = require('buffer-equal') +var ipLib = require('ip') var common = require('./common') @@ -38,7 +39,7 @@ function parseUdpRequest (msg, rinfo) { params.ip = msg.readUInt32BE(84) // optional params.ip = params.ip ? ipLib.toString(params.ip) : - params.ip = rinfo.address + rinfo.address params.key = msg.readUInt32BE(88) // TODO: what is this for? params.numwant = msg.readUInt32BE(92) // optional // never send more than MAX_ANNOUNCE_PEERS or else the UDP packet will get bigger than diff --git a/server.js b/server.js index e567835..8fb4aaa 100644 --- a/server.js +++ b/server.js @@ -6,7 +6,6 @@ var dgram = require('dgram') var EventEmitter = require('events').EventEmitter var http = require('http') var inherits = require('inherits') -var ipLib = require('ip') var portfinder = require('portfinder') var series = require('run-series') var string2compact = require('string2compact')