summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mon/MonMap.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mon/MonMap.cc b/src/mon/MonMap.cc
index 5598bbe8709..8d0540d71f2 100644
--- a/src/mon/MonMap.cc
+++ b/src/mon/MonMap.cc
@@ -196,7 +196,12 @@ void MonMap::encode(ceph::buffer::list& blist, uint64_t con_features) const
if (!HAVE_FEATURE(con_features, MONENC) ||
!HAVE_FEATURE(con_features, SERVER_NAUTILUS)) {
for (auto& [name, info] : mon_info) {
- legacy_mon_addr[name] = info.public_addrs.legacy_addr();
+ // see note in mon_info_t::encode()
+ auto addr = info.public_addrs.legacy_addr();
+ if (addr == entity_addr_t()) {
+ addr = info.public_addrs.as_legacy_addr();
+ }
+ legacy_mon_addr[name] = addr;
}
}