Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Handle discovery where multiple LAN interfaces exist #104

Copy link
Copy link
@eode

Description

@eode
Issue body actions

My network arrangement:
modem->wireless bridge a->wireless bridge b->rpi qos & automation->wifi/lan bridge->clients, including hs300.

For the purposes of this discussion, we can simplify that to:
modem->rpi->wifi->hs300

When discovery occurs, from what I can tell, an arbitrary interface (the first interface, linked to the modem) on the rpi is selected. This means the wrong network gets the broadcast packet (which would need to go out via wifi).

This is a known issue, as discussed here, and it can be resolved as discussed in the previous link and here. Also useful is this article about selecting interfaces in linux vs windows

The crux of it is basically:

sockets = []

if windows:
    for address in AF_INET addresses:
        sockets.append(<a new socket, bound to that address>)

if linux/osx:
    for index, interface in socket.if_nameindex():
        sockets.append(<a new socket, bound to that interface>)

for socket in sockets:
    <do discovery>

Obviously, there are additional considerations in the actual coding. Also, there are some ugly convolutions on Windows -- specifically, although you can select the interface to use by binding one of its IP addresses, there's no nice way to get a list of IP addresses. This may mean a module dependency such as netifaces.

Thank you!

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.