From: Marcin Siodelski Date: Fri, 13 Jun 2014 18:08:05 +0000 (+0200) Subject: [3437] Do not bind socket to multicast address on Linux. X-Git-Tag: trac3473_base~2^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b84e07e6bbfefdc4971d5a4c6f49b7fbdcd62b86;p=thirdparty%2Fkea.git [3437] Do not bind socket to multicast address on Linux. --- diff --git a/src/lib/dhcp/iface_mgr_linux.cc b/src/lib/dhcp/iface_mgr_linux.cc index f4b0613dd8..d258b239c6 100644 --- a/src/lib/dhcp/iface_mgr_linux.cc +++ b/src/lib/dhcp/iface_mgr_linux.cc @@ -556,35 +556,6 @@ IfaceMgr::openMulticastSocket(Iface& iface, return (false); } - - // To receive multicast traffic, Linux requires binding socket to - // the multicast address. - - /// @todo The DHCPv6 requires multicast so we may want to think - /// whether we want to open the socket on a multicast-incapable - /// interface or not. For now, we prefer to be liberal and allow - /// it for some odd use cases which may utilize non-multicast - /// interfaces. Perhaps a warning should be emitted if the - /// interface is not a multicast one. - if (iface.flag_multicast_) { - try { - openSocket(iface.getName(), - IOAddress(ALL_DHCP_RELAY_AGENTS_AND_SERVERS), - port); - } catch (const Exception& ex) { - // An attempt to open and bind a socket to multicast addres - // has failed. We have to close the socket we previously - // bound to link-local address - this is everything or - // nothing strategy. - iface.delSocket(sock); - IFACEMGR_ERROR(SocketConfigError, error_handler, - "Failed to open multicast socket on" - " interface " << iface.getName() - << ", reason: " << ex.what()); - return (false); - } - } - // Both sockets have opened successfully. return (true); }