Indy
Indy copied to clipboard
TIdIPMCastServer is missing a required call to setSockOpt for IPv6
Please refer to this SO post:
https://stackoverflow.com/questions/31574247/gcdasyncudpsocket-cannot-get-udp-multicast-over-ipv6-to-work
As per the post, in order for multicast sending to work with IPv6 (at least on iOS, and probably for macOS), a call must be made to setSockOpt()
for the IPV6_MULTICAST_IF
option, otherwise a send causes a "No route to host" error. This call requires passing the desired interface index, so the change would require discovery of the interface index associated with the address.
I've managed to work around the issue by "hacking" the TIdStackVCLPosix.GetLocalAddressList()
method in the IdStackVCLPosix
unit to associate the index (obtained by calling if_nametoindex(LAddrInfo^.ifa_name)
) with the IP address into a dictionary of IP addresses/indexes, and calling SetSockOpt()
on the binding by looking up the index for the address. Anyone who is interested can contact me for the workaround