]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/ipaddr: Allow binding on lo 38925/head
authorThomas Goirand <zigo@debian.org>
Fri, 15 Jan 2021 09:50:05 +0000 (10:50 +0100)
committerKefu Chai <kchai@redhat.com>
Fri, 15 Jan 2021 14:38:35 +0000 (22:38 +0800)
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 <zigo@debian.org>
src/common/ipaddr.cc

index 16114093798989f7519da6a7a31b81a2eb4a1158..f9cfbd5598adf85ef8b76a178b4bdf672c5be8df 100644 (file)
@@ -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))