]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: assert the address is v2 on attempt to bind. 43118/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 9 Sep 2021 14:42:04 +0000 (14:42 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 9 Sep 2021 14:44:48 +0000 (14:44 +0000)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/net/SocketMessenger.cc

index 12010b8625f3b4c8aea384793c773baf06029370..6b5dd19f1e798956342e0c07c1444c3068a7d965 100644 (file)
@@ -88,7 +88,11 @@ SocketMessenger::bind_ertr::future<>
 SocketMessenger::try_bind(const entity_addrvec_t& addrs,
                           uint32_t min_port, uint32_t max_port)
 {
-  auto addr = addrs.front();
+  // the classical OSD iterates over the addrvec and tries to listen on each
+  // addr. crimson doesn't need to follow as there is a consensus we need to
+  // worry only about proto v2.
+  assert(addrs.size() == 1);
+  auto addr = addrs.msgr2_addr();
   if (addr.get_port() != 0) {
     return do_bind(addrs).safe_then([this] {
       logger().info("{} try_bind: done", *this);