The internal miniserver.c uses INADDR_ANY instead of the HostIP/IfName provided when initializing libupnp. But, this HostIP/IfName gets used for the UDP socket when multicasting SSDP messages.
In my situation this causes a problem, since I want to use libupnp with 127.0.0.1 (localhost) but the SSDP multicast gets signalled to the regular network interface as well, where another software connects to the miniserver, thus binding the miniserver's socket to that particular interface and not to 127.0.0.1 (INADDRY_ANY binds the socket to the first interface a connection attempt is received from).
Attached patch fixes this issue for IPV4. Unfortunately, I don't know how to handle this for IPV6 (which I don't need btw.).
Is there any reason to explicitly use INADDR_ANY for the miniserver? Or could you consider using the attached patch and extend it for IPV6?
Log in to post a comment.