On BSD the multicast packets are received on the socket bound to any
address. So, the packets sent to global unicast address must be filtered
out by the DHCP server.
isc_throw(SocketReadError, "failed to receive data");
}
+ // Filter out packets sent to global unicast address (not link local and
+ // not multicast) if the socket is set to listen multicast traffic and
+ // is bound to in6addr_any. The traffic sent to global unicast address is
+ // received via dedicated socket.
+ IOAddress local_addr = IOAddress::fromBytes(AF_INET6,
+ reinterpret_cast<const uint8_t*>(&to_addr));
+ if ((socket_info.addr_ == IOAddress("::")) &&
+ !(local_addr.isV6Multicast() || local_addr.isV6LinkLocal())) {
+ return (Pkt6Ptr());
+ }
+
// Let's create a packet.
Pkt6Ptr pkt;
try {