-
Notifications
You must be signed in to change notification settings - Fork 21
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
Interface bind on Linux doesn't really work for listening #47
Comments
I think this may in fact be true; let me keep testing! |
Closing issue as this seems to have been a product of #45 |
Coming back to this issue and re-opening it as I've now had to properly triage what is causing it. I've done a fresh install of Ubuntu 22.04 with Python 3.10.2 and 5.15.0-112-generic. The host has two IP interfaces: ens3: 192.168.1.211/24 I have started sACNView on another host and told it to broadcast onto Universe 1 on the the ens4 network. I confirmed that tcpDump can see the packets on the ens4 network. The following does not receive any incoming packets on the ens4 interface as far as the code is concerned.
So having tested that, I checked out a local copy of the sacn package and started tinkering. The following change does, however, make everything work:
After making this change, I checked the following: The following receives packets (as expected):
The following does not receive packets (probably as expected?)
Changing the source to be on the other interface (facing 192.168.1.211) will cause the host to receive packets in the second scenario (because ens3 is the first interface on the host). This also reflects the multicast membership joins. Interestingly, in all cases, specifying the correct interface always resulted in the |
Proposed fix for Hundemeier#47 - allowing for differences between Windows and Linux. Noting that I'm not clear that the Windows implementation is needed; but I don't have the ability to test that.
As the notes indicate, the interface bind on Linux doesn't work, particularly when we are dealing with multicast traffic. There are a range of reasons for this, but the socket implementation doesn't really lend itself to being used in this way.
The fix for this is to do something like:
It would be nice to simply extend sACNreceiver to allow this to be set without requiring a bit of internal digging to find that interface name. This is obviously a Linux only implementation; and I'm not sure that it is quite the same to implement in Windows - I have specifically not tested this in this environment.
I have tested this in Python 3.9+ on a range of 5 series kernels without issue.
The text was updated successfully, but these errors were encountered: