From 8e416bcf954fd4a0d0d854e5dac69eba51d29ad1 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 21 Apr 2021 19:50:48 +0800 Subject: [PATCH] common/pick_address: prefer non-loopback addresses instead of filtering out loopback ifaces, check for loopback addresses, and prefer non-loopback addresses over loopback addresses. before this change, iface named "lo" is filtered out by default, and "lo" is allowed if `ms_bind_exclude_lo_iface` is false. after this change, iface with address out of 127/8 is prefered. the iface marked down is not considered. the option of "ms_bind_exclude_lo_iface" is removed. the tests are updated accordingly. Fixes: https://tracker.ceph.com/issues/50456 Signed-off-by: Kefu Chai (cherry picked from commit a9b9bcd53215a07608a28ac2c8e4a8c8b8e80e66) Conflicts: src/common/options/global.yaml.in src/common/pick_address.cc: trivial resolution --- src/common/options.cc | 5 --- src/common/pick_address.cc | 90 ++++++++++++++++++++++++-------------- src/common/pick_address.h | 1 - src/test/test_ipaddr.cc | 57 ++++++++++-------------- 4 files changed, 79 insertions(+), 74 deletions(-) diff --git a/src/common/options.cc b/src/common/options.cc index a5dbd0b65cb7f..85f4203be3686 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -997,11 +997,6 @@ std::vector