From: Tomek Mrugalski Date: Tue, 30 Oct 2012 17:59:50 +0000 (+0100) Subject: [2414] IfaceMgr now binds link-local addresses only. X-Git-Tag: trac2487_base~1^2~31^2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90bb56b150b1c51690dffce834bff4b91f754111;p=thirdparty%2Fkea.git [2414] IfaceMgr now binds link-local addresses only. --- diff --git a/src/lib/dhcp/iface_mgr.cc b/src/lib/dhcp/iface_mgr.cc index ecaa652949..1c2a11c569 100644 --- a/src/lib/dhcp/iface_mgr.cc +++ b/src/lib/dhcp/iface_mgr.cc @@ -247,6 +247,15 @@ bool IfaceMgr::openSockets6(const uint16_t port) { continue; } + // Bind link-local addresses only. Otherwise we bind several sockets + // on interfaces that have several global addresses. For examples + // with interface with 2 global addresses, we would bind 3 sockets + // (one for link-local and two for global). That would result in + // getting each message 3 times. + if (!addr->getAddress().to_v6().is_link_local()){ + continue; + } + sock = openSocket(iface->getName(), *addr, port); if (sock < 0) { isc_throw(SocketConfigError, "failed to open unicast socket");