Skip to content

Commit 14b0951

Browse files
author
shenjiatong
committed
Make mon addrs consistent with mon info
For legacy librbd clients, sanitize_mons will panic if addrs are not consistent with mon_info_t. Signed-off-by: shenjiatong <[email protected]> fixes: https://tracker.ceph.com/issues/68743
1 parent 28887e2 commit 14b0951

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/mon/MonMap.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,12 @@ void MonMap::encode(ceph::buffer::list& blist, uint64_t con_features) const
196196
if (!HAVE_FEATURE(con_features, MONENC) ||
197197
!HAVE_FEATURE(con_features, SERVER_NAUTILUS)) {
198198
for (auto& [name, info] : mon_info) {
199-
legacy_mon_addr[name] = info.public_addrs.legacy_addr();
199+
// see note in mon_info_t::encode()
200+
auto addr = info.public_addrs.legacy_addr();
201+
if (addr == entity_addr_t()) {
202+
addr = info.public_addrs.as_legacy_addr();
203+
}
204+
legacy_mon_addr[name] = addr;
200205
}
201206
}
202207

0 commit comments

Comments
 (0)