ProSafeLinux
ProSafeLinux copied to clipboard
Discover Bug
Running the discover command I got this error: Searching for ProSafe Plus Switches ...
Traceback (most recent call last):
File "./psl-cli.py", line 191, in
I'm using Python 2.7.3 and Fedora 18. This might be user error on my part.
Which command did you use when getting this error?
It was ./psl-cli.py --interface em1 discover
I ran into the same problem. I did some investigation. if I do "./psi-cli --interface wlan0 discover" I have the same problem, except when I plug in a network cable into the same network so eth0 comes up. If I check with wireshark, I see a outgoing broadcast UDP packet to port 63322, from source port 63321. My switch sends a reply packet. All over eth0! Even if I explicitly replace 'eth0' by 'wlan0' in the sources this does not change. It seems binding to a specific interface fails somehow. And, there is some dependency on eth0 that I cannot find.
Ok, after some more testing (and googling..) I found a solution: in file psl_class.py on line 152 (in function bind()) change self.rsocket.bind(("255.255.255.255", self.RECPORT)) to self.rsocket.bind(("", self.RECPORT)) This will effectively change the listening address from INADDR_BROADCAST to INADDR_ANY; the first apparently does not work reliably (on linux?). The latter works correctly. Just in case this is important for someone: I tested this on linux 3.9.4
Thanks josn0! I've fixed the problem and created a pull request. I don't know why binding to INADDR_BROADCAST doesn't work here, but as setting to INADDR_ANY fixes the thing that should be fine. The only way to use INADDR_ANY and additionally binding to a specific interface would need us to use SO_BINDTODEVICE which is a privileged option and i don't think the netgear client should be run as root :) Package sending is correctly bind to the given INTERFACE so that change should fix the problem.