From: Wido den Hollander Date: Tue, 13 Mar 2018 10:13:48 +0000 (+0100) Subject: common/ipaddr: Do not select link-local IPv6 addresses X-Git-Tag: v13.1.0~460^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9a110662046cb2c2a052b8e1adf062b593955248;p=ceph.git common/ipaddr: Do not select link-local IPv6 addresses 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 --- diff --git a/src/common/ipaddr.cc b/src/common/ipaddr.cc index 27b9cdff2b16..6baf7898285e 100644 --- a/src/common/ipaddr.cc +++ b/src/common/ipaddr.cc @@ -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);