]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ntp_io.c:
authorFrank Kardel <kardel@ntp.org>
Sun, 15 Oct 2006 06:03:07 +0000 (06:03 +0000)
committerFrank Kardel <kardel@ntp.org>
Sun, 15 Oct 2006 06:03:07 +0000 (06:03 +0000)
  Bug 715:
  Fix from Peter Pramberger
  do not send link scoped multicasts with a glocbal source address
  (if present on that interface)

bk: 4531cf1bH7s21OIZZnPwIzHivbuojg

ntpd/ntp_io.c

index c204020d869aeb6c1e67bf922c459cc91edac001..f94b380ca87478971b6095deaf46891b2dabcfcf 100644 (file)
@@ -3367,11 +3367,18 @@ findbcastinter(
 #endif
                /*
                 * If we are looking to match a multicast address grab it.
-                * We must not do this before we have eliminated any linklocal
-                * addresses
                 */
                if (addr_ismulticast(addr) == ISC_TRUE && interface->flags & INT_MULTICAST)
                {
+#ifdef INCLUDE_IPV6_SUPPORT
+                       if(addr->ss_family == AF_INET6) {
+                               /* Only use link-local address for link-scope mcast */
+                               if(IN6_IS_ADDR_MC_LINKLOCAL(&((struct sockaddr_in6*)addr)->sin6_addr) &&
+                                 !IN6_IS_ADDR_LINKLOCAL(&((struct sockaddr_in6*)&interface->sin)->sin6_addr)) {
+                                       continue;
+                               }
+                       }
+#endif
                        break;
                }