]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3437] Do not bind socket to multicast address on Linux.
authorMarcin Siodelski <marcin@isc.org>
Fri, 13 Jun 2014 18:08:05 +0000 (20:08 +0200)
committerMarcin Siodelski <marcin@isc.org>
Fri, 13 Jun 2014 18:08:05 +0000 (20:08 +0200)
src/lib/dhcp/iface_mgr_linux.cc

index f4b0613dd8ab1675caf0d4090686977d556f3a20..d258b239c6e5fbaec111a1926d0e20477c35ffa7 100644 (file)
@@ -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);
 }