How do you get a socket to receive packets destined for the IPv6 Subnet-Routers Anycast address?
I haven't been able to find any informationn on how to do this.
In a fit of desparation, I've tried using socket.setsockopt as you would to join a multicast group:
# 7 is the interface number
s = socket(AF_INET6, SOCK_DGRAM)
packed_iface_num = struct.pack("I", 7)
group = inet_pton(AF_INET6, 'fd36:d00d:d00d:47cb::') + packed_iface_num
# socket.error: (22, 'Invalid argument')
s.setsockopt(IPPROTO_IPV6, IPV6_JOIN_GROUP, group)
And also using bind
# socket.error: (99, 'Cannot assign requested address')
s.bind(('fd36:773e:6b4c:47cb::', 9876))
As expected, neither of these worked. Is there a way to do this?