From 297ce6092a27b99d63a12e928b27d27e2b4a713b Mon Sep 17 00:00:00 2001 From: Ricardo Dias Date: Wed, 20 Nov 2019 10:42:18 +0000 Subject: [PATCH] ceph-mon: keep v1 address type when explicitly set Fixes: https://tracker.ceph.com/issues/42906 Signed-off-by: Ricardo Dias (cherry picked from commit a97893e409050afcedb6e77c06e09d5b8a11b8d0) --- src/ceph_mon.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ceph_mon.cc b/src/ceph_mon.cc index f51dce57e62f1..2d73294b4096f 100644 --- a/src/ceph_mon.cc +++ b/src/ceph_mon.cc @@ -194,9 +194,11 @@ entity_addrvec_t make_mon_addrs(entity_addr_t a) } else if (a.get_port() == CEPH_MON_PORT_LEGACY) { a.set_type(entity_addr_t::TYPE_LEGACY); addrs.v.push_back(a); - } else { + } else if (a.get_type() == entity_addr_t::TYPE_ANY) { a.set_type(entity_addr_t::TYPE_MSGR2); addrs.v.push_back(a); + } else { + addrs.v.push_back(a); } return addrs; } -- 2.39.5