From 9a110662046cb2c2a052b8e1adf062b593955248 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Tue, 13 Mar 2018 11:13:48 +0100 Subject: [PATCH] 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 --- src/common/ipaddr.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/ipaddr.cc b/src/common/ipaddr.cc index 27b9cdff2b1..6baf7898285 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); -- 2.47.3