GNOME Bugzilla – Bug 711320
Not possible to use rygel from routed local networks
Last modified: 2019-02-22 09:29:20 UTC
Rygel seems to do autodetection of local networks based on the IP and netmask set on the interfaces on the box rygel is running on and then only answering DLNA queries from those networks. This means that routed local networks is not able to get response from Rygel. To reproduce: In my local network I have the following setup local lan (192.168.0.0/24) - (.1) router - internet local wlan (192.168.1.0/24) / Running rygel on my machine on the local lan (192.168.0.199) it receives multicast packages from my phone on the wlan, but will not respond to it. If I however trick rygel by running ip addr add 192.168.0.199/23 dev eth0 ip route del 192.168.0.0/23 dev eth0 proto kernel scope link src 192.168.0.199 I can reach rygel just fine from my phone. Either rygel should not figure out on its own what networks is allowed and leave this up the the local router or an option to list local networks should be added.
This is handled in GSSDP
Basically this needs changing recvfrom to recvmsg and process the information in the msg structure (and setting the proper socket options, IP_PKTINFO on linux and whatever it is on BSD/Win32) instead of doing netmask matching for the source packages to determine the network interface the packet was received on.
meh, if we were to use g_socket_receive_message, we'd also need to implement a subclass of GSocketControlMessage, otherwise we don't get any message back :-/
Created attachment 271991 [details] [review] Use pktinfo to determine destination client. Does this patch help you?
Yes, this patch solved the problem, thank you.
Thanks. so we now "just" make that a nice, portable implementation... ;)