]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/ipaddr: Do not select link-local IPv6 addresses 20862/head
authorWido den Hollander <wido@42on.com>
Tue, 13 Mar 2018 10:13:48 +0000 (11:13 +0100)
committerWido den Hollander <wido@42on.com>
Tue, 13 Mar 2018 11:09:27 +0000 (12:09 +0100)
They are not suited to be used with Ceph and should not be selected
as a address to bind on.

Fixes: http://tracker.ceph.com/issues/21813
Signed-off-by: Wido den Hollander <wido@42on.com>
src/common/ipaddr.cc

index 27b9cdff2b166cbc70d48ee22f55414960c349c2..6baf7898285ef5bf89230a244410914cb33bd36a 100644 (file)
@@ -89,6 +89,9 @@ const struct ifaddrs *find_ipv6_in_subnet(const struct ifaddrs *addrs,
     if (addrs->ifa_addr->sa_family != net->sin6_family)
       continue;
 
+    if (IN6_IS_ADDR_LINKLOCAL(addrs->ifa_addr))
+      continue;
+
     struct in6_addr *cur = &((struct sockaddr_in6*)addrs->ifa_addr)->sin6_addr;
     netmask_ipv6(cur, prefix_len, &temp);