christgau / wsdd

A Web Service Discovery host daemon.
MIT License
861 stars 101 forks source link

wsdd breaks sane-airscan ability to find network devices #95

Closed Xavron closed 3 years ago

Xavron commented 3 years ago

Went through a whole lot and with the help of alexpevzner alexpevzner/sane-airscan/issues/130 found the result was wsdd running caused sane-airscan to fail to find any devices over the network.

He recommends this:

Seems that its author forgot to tell SO_REUSEADDR on listening multicast socket. Its better to fix there.

If you could look into the problem it would be great. Thanks.

Xavron commented 3 years ago

I do see you have

self.recv_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

But I definitely don't know enough about all that.

If there's some other problem and you need a log or something let me know. I can't speak for him but alexpevzner sounds like he might be willing to offer some help in avoiding the conflict. What he does is up to him.

Xavron commented 3 years ago

Think I figured it out. Looks like the tutorial I followed might be the cause. wsdd has a distro provided package that I didn't see previously and I believe is working alright that way.

If you can't reproduce then you can close it. I believe this is solved.

Ex. on Fedora scanimage -L should show network scanning devices if you have one that's compatible and working. Many do.

alexpevzner commented 3 years ago

Hi,

I'm the sane-airscan author, and I was investigating this problem together with @Xavron tomorrow.

The sane-airscan (https://github.com/alexpevzner/sane-airscan) is SANE backend (driver) which implements eSCL and WSD scanners support. For WSD, it implements WS-Discovery by itself, so it needs to be able to receive WSD multicasts.

Looking to the wsdd sources, I see that SO_REUSEADDR option is properly set on self.recv_socket, but not set on self.mc_send_socket, which is also bound to WSD_UDP_PORT, which effectively prevents sane-airscan from being able to bind to the 0:3702 port.

Please, fix

christgau commented 3 years ago

Thanks to you two for nailing that one down. I'll fix it...