0

I am trying to implement IPv6 multicast using boost library (1.61.0). However, I am getting the following error in macOS (OSX 10.10, 10.11, 10.12) and only for link-local (Global IPv6 works). I do not get this error on Ubuntu (14.04, 16.04, 17.10). The netif.getIndex() gets the interface index for link-local. Where am I doing wrong?

Error:

boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >: set_option: Can't assign requested address

Here's my code segment for IPv6 multicast:

receiveSocket.bind(udp::Endpoint(localEndpoint.address(), multicastEndpoint.port()));
receiveSocket.set_option(ip::multicast::join_group(multicastEndpoint.address().to_v6()));

if (!localEndpoint.address().is_unspecified()) {
   sendSocket.set_option(ip::multicast::outbound_interface(netif.getIndex()));
}
sendSocket.set_option(ip::multicast::join_group(multicastEndpoint.address().to_v6()));
Ashiq
  • 13
  • 5
  • Can you clarify which `set_option` fails? What is `netif`? Does the remark `"The netif.getIndex() gets the interface index for link-local"` describe the intended behaviour, or the actual behaviour? And if that is actual behaviour, is it on macOS, or on Ubuntu as well? – sehe Nov 08 '17 at 13:05
  • I tried using both gdb and lldb, however, I am not getting the exact line number where the error is occuring. As for netif.getIndex(), it's generic and method written to get index number of interface of the IPv6 address. The error in the actual post occurs only in macOS, and passes in Ubuntu. – Ashiq Nov 09 '17 at 03:22

0 Answers0