Browse Source

Do not crash on empty matched_addrs

test-assert
Vitaliy Filippov 5 months ago
parent
commit
b376ef2ed9
  1. 8
      src/osd.cpp

8
src/osd.cpp

@ -179,6 +179,14 @@ void osd_t::bind_socket()
fprintf(stderr, "More than 1 address matches requested network(s): %s\n", json11::Json(matched_addrs).dump().c_str());
force_stop(1);
}
if (!matched_addrs.size())
{
std::string nets;
for (auto v: mask)
nets += (nets == "" ? v : ","+v);
fprintf(stderr, "Addresses matching osd_network(s) %s not found\n", nets.c_str());
force_stop(1);
}
bind_address = matched_addrs[0];
}

Loading…
Cancel
Save