Skip to content

Commit

Permalink
common/ipaddr: Do not select link-local IPv6 addresses
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
wido committed Mar 13, 2018
1 parent 6432786 commit 9a11066
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/common/ipaddr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 9a11066

Please sign in to comment.