From: Thomas Goirand Date: Fri, 15 Jan 2021 09:50:05 +0000 (+0100) Subject: common/ipaddr: Allow binding on lo X-Git-Tag: v16.1.0~13^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=201b59204374ebdab91bb554b986577a97b19c36;p=ceph-ci.git common/ipaddr: Allow binding on lo Commmit 5cf0fa872231f4eaf8ce6565a04ed675ba5b689b, solves the issue that the osd can't restart after seting a virtual local loopback IP. However, this commit also prevents a bgp-to-the-host over unumbered Ipv6 local-link is setup, where OSD typically are bound to the lo interface. To solve this, this single char patch simply checks against "lo:" to match only virtual interfaces instead of anything that starts with "lo". Fixes: https://tracker.ceph.com/issues/48893 Signed-off-by: Thomas Goirand --- diff --git a/src/common/ipaddr.cc b/src/common/ipaddr.cc index 16114093798..f9cfbd5598a 100644 --- a/src/common/ipaddr.cc +++ b/src/common/ipaddr.cc @@ -60,7 +60,7 @@ const struct ifaddrs *find_ipv4_in_subnet(const struct ifaddrs *addrs, if (addrs->ifa_addr == NULL) continue; - if (boost::starts_with(addrs->ifa_name, "lo")) + if (boost::starts_with(addrs->ifa_name, "lo:")) continue; if (numa_node >= 0 && !match_numa_node(addrs->ifa_name, numa_node))