Closed fzs closed 1 year ago
It's probably a remnant from when I tried out various methods for the multiple-interface support. I had this idea to use a single socket and the IP_PKTINFO
to fish out the ingressing interface.
So yes, I believe we can remove it. You're more than welcome to submit a PR.
I will have to do a bit of cleanup when adding IPv6 multicast sockets.
The function does a lot more than it used to way back, setting values explicitly where before the default was kept. Examples are multicast loop and all. Is this on purpose to make sure to override defaults on different systems with consistent values?
Yes. The others are quite well hashed out over the years in other daemon's I maintain that do multicast on multiple interfaces.
You can have a look at SMCRoute and pim6sd for inspiration, and perhaps some help, when going through the socket setup. Both support IPv6.
At some point the socket option
IP_PKTINFO
was getting set on the server's socket. I found no explanation for this. Since the code doesn't even usesendmsg
orrecvmsg
, can this be removed?https://github.com/troglobit/mdnsd/blob/5fb29c76cb8a310f3f9bfdf16ce5bcbe1e40ca7e/src/mdnsd.c#L245