Skip to content

Commit

Permalink
only add addresses for the current interface in question
Browse files Browse the repository at this point in the history
  • Loading branch information
agnat committed Aug 30, 2010
1 parent 5ce7ec0 commit 8752474
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ Resolver.prototype._onResolve = function(sdRef, flags, interfaceIndex,
var addressInfoGetter = new MDNSService();
var addresses = [];
capi.dnsServiceGetAddrInfo(addressInfoGetter.serviceRef, 0, 0, 0, hosttarget,
function(sdRef, adrFlags, interfaceIndex, errorCode, hostname, address, context) {
function(sdRef, adrFlags, adrIface, errorCode, hostname, address, context) {
var error = capi.buildException(errorCode);
if (error) {
self.callback(error)
addressInfoGetter.stop()
} else {
addresses.push(address);
if (adrIface == interfaceIndex) {
addresses.push(address);
}
if ( ! (capi.kDNSServiceFlagsMoreComing & adrFlags)) {
info.addresses = addresses;
self.callback(null, info, flags);
Expand Down

0 comments on commit 8752474

Please sign in to comment.