Skip to content

Commit

Permalink
Merge pull request #7747 from vsjulu/master
Browse files Browse the repository at this point in the history
xio: fix incorrect ip being assigned in case of multiple RDMA ports

Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
tchaikov committed Feb 27, 2016
2 parents 894738f + 837dcc5 commit 8c054f7
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions src/msg/xio/XioMessenger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -697,30 +697,9 @@ int XioMessenger::bind(const entity_addr_t& addr)
struct entity_addr_t _addr = *a;

if (a->is_blank_ip()) {
a = &_addr;
std::vector <std::string> my_sections;
cct->_conf->get_my_sections(my_sections);
std::string rdma_local_str;
if (cct->_conf->get_val_from_conf_file(my_sections, "rdma local",
rdma_local_str, true) == 0) {
struct entity_addr_t local_rdma_addr;
local_rdma_addr = *a;
const char *ep;
if (!local_rdma_addr.parse(rdma_local_str.c_str(), &ep)) {
ldout(cct,0) << "ERROR: Cannot parse rdma local: " << rdma_local_str << dendl;
return -EINVAL;
}
if (*ep) {
ldout(cct,0) << "WARNING: 'rdma local trailing garbage ignored: '" << ep << dendl;
}
ldout(cct, 2) << "Found rdma_local address " << rdma_local_str.c_str() << dendl;
int p = _addr.get_port();
_addr.set_sockaddr(reinterpret_cast<struct sockaddr *>(
&local_rdma_addr.ss_addr()));
_addr.set_port(p);
} else {
ldout(cct,0) << "WARNING: need 'rdma local' config for remote use!" <<dendl;
}
lderr(cct) << "ERROR: need rdma ip for remote use! " << dendl;
cout << "Error: xio bind failed. public/cluster ip not specified" << std::endl;
return -1;
}

entity_addr_t shift_addr = *a;
Expand All @@ -736,6 +715,7 @@ int XioMessenger::bind(const entity_addr_t& addr)
shift_addr.set_port(port0);
shift_addr.nonce = nonce;
set_myaddr(shift_addr);
need_addr = false;
did_bind = true;
}
return r;
Expand Down

0 comments on commit 8c054f7

Please sign in to comment.