Skip to content

Discovery does not work on FreeBSD 11.1 #105

Open
@displaced

Description

@displaced

Hi,

This is a problem common to several pieces of cross-platform software which attempt to use broadcast pings.

If I understand the docs correctly, FreeBSD will interpret 255.255.255.255 as broadcast on the first IP interface with the IFF_BROADCAST flag set -- which I think appears to be the loopback interface (lo0). Whichever it is, it's definitely not my LAN interface!

I think the IP_ONESBCAST socket option might change it to the Linux-y meaning of broadcast on all interfaces.

A quick workaround is to specify the broadcast address of the interface I want to broadcast on (my LAN interface). To do this, I edited:

/usr/local/lib/node_modules/homebridge-harmonyhub/node_modules/harmonyhubjs-discover/lib/ping.js

I changed line 9 from this.address = '255.255.255.255' to this.address = '192.168.50.255', since my network's subnet is 192.168.50.0/24. Other FreeBSD users would need to adjust as necessary.

As I say, this problem is prevalent amongst software which is FreeBSD-compatible in every other way, but is easily worked-around. Not sure if it's possible for ping libraries to check their platform first, but very few seem to!

Hope that helps out some people!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions