OPTION(ms_die_on_bad_msg, OPT_BOOL, false)
OPTION(ms_dispatch_throttle_bytes, OPT_U64, 100 << 20)
OPTION(ms_bind_ipv6, OPT_BOOL, false)
+OPTION(ms_bind_port_min, OPT_INT, 6800)
+OPTION(ms_bind_port_max, OPT_INT, 6900)
OPTION(ms_rwthread_stack_bytes, OPT_U64, 1024 << 10)
OPTION(ms_tcp_read_timeout, OPT_U64, 900)
OPTION(ms_inject_socket_failures, OPT_U64, 0)
* that would like to identify the protocol.
*/
#define CEPH_PORT_FIRST 6789
-#define CEPH_PORT_START 6800 /* non-monitors start here */
-#define CEPH_PORT_LAST 6900
/*
* tcp connection banner. include a protocol version. and adjust
}
} else {
// try a range of ports
- for (int port = CEPH_PORT_START; port <= CEPH_PORT_LAST; port++) {
+ for (int port = cct->_conf->ms_bind_port_min; port <= cct->_conf->ms_bind_port_max; port++) {
if (port == avoid_port1 || port == avoid_port2)
continue;
listen_addr.set_port(port);
if (rc < 0) {
char buf[80];
ldout(msgr->cct,0) << "accepter.bind unable to bind to " << listen_addr.ss_addr()
- << " on any port in range " << CEPH_PORT_START << "-" << CEPH_PORT_LAST
+ << " on any port in range " << cct->_conf->ms_bind_port_min << "-" << cct->_conf->ms_bind_port_max
<< ": " << strerror_r(errno, buf, sizeof(buf)) << dendl;
cerr << "accepter.bind unable to bind to " << listen_addr.ss_addr()
- << " on any port in range " << CEPH_PORT_START << "-" << CEPH_PORT_LAST
+ << " on any port in range " << cct->_conf->ms_bind_port_min << "-" << cct->_conf->ms_bind_port_max
<< ": " << strerror_r(errno, buf, sizeof(buf)) << std::endl;
return -errno;
}