From 201b59204374ebdab91bb554b986577a97b19c36 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Fri, 15 Jan 2021 10:50:05 +0100 Subject: [PATCH] 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 --- src/common/ipaddr.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/ipaddr.cc b/src/common/ipaddr.cc index 1611409379898..f9cfbd5598adf 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)) -- 2.39.5