Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null hostname on lo0 #133

Open
AlexOwen opened this issue Apr 23, 2015 · 1 comment
Open

Null hostname on lo0 #133

AlexOwen opened this issue Apr 23, 2015 · 1 comment

Comments

@AlexOwen
Copy link

I am getting a fatal error when a service on the local machine closes down due to the advert not returning a hostname (on OSX). The error is as follows:

events.js:85
      throw er; // Unhandled 'error' event
            ^
TypeError: argument 5 must be a string (hostname)
    at TypeError (native)
    at Array.DNSServiceGetAddrInfo (.../node_modules/mdns/lib/resolver_sequence_tasks.js:93:14)
    at next (.../node_modules/mdns/lib/browser.js:107:21)
    at MDNSService.on_resolver_done (.../mdns/lib/resolver_sequence_tasks.js:33:11)
    at SocketWatcher.MDNSService.self.watcher.callback (.../node_modules/mdns/lib/mdns_service.js:18:40)

The description of the service is this:

{"interfaceIndex":4294967295,"type":{"name":"http","protocol":"tcp","subtypes":[],"fullyQualified":true},"replyDomain":"local.","flags":3,"name":"PC","networkInterface":"lo0"}

Whereas a normal service is this:

{"interfaceIndex":4,"type":{"name":"http","protocol":"tcp","subtypes":[],"fullyQualified":true},"replyDomain":"local.","flags":2,"name":"PC","networkInterface":"en0","fullname":"PC._http._tcp.local.","host":"PC.local.","port":8080}

I can fix this by changing from line 92 in resolver_sequence_tasks.js to this:

if (typeof(service.host) !== 'undefined') {
        dns_sd.DNSServiceGetAddrInfo(
            adr_getter.serviceRef, 0, service.interfaceIndex, family_flags,
            service.host, on_get_addr_info_done, null);

        adr_getter.start();
      }

However I think there is a deeper problem as this occurs even when the networkInterface is set to en0 only.

@albohlabs
Copy link

Same problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants