]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2414] IfaceMgr now binds link-local addresses only.
authorTomek Mrugalski <tomasz@isc.org>
Tue, 30 Oct 2012 17:59:50 +0000 (18:59 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Tue, 30 Oct 2012 17:59:50 +0000 (18:59 +0100)
src/lib/dhcp/iface_mgr.cc

index ecaa652949e7a9f75637701e3985d122c1656574..1c2a11c5690a4b96daa430967505c46804fddb57 100644 (file)
@@ -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");