It checks the validty of monitor port configuration
in ceph.conf, and warns if necessary.
Signed-off-by: Li Wang <laurence.liwang@gmail.com>
<< " does not match monmap file" << std::endl
<< " continuing with monmap configuration" << dendl;
}
- }
+ } else
+ derr << "WARNING: invalid 'mon addr' config option" << std::endl
+ << " continuing with monmap configuration" << dendl;
}
} else {
dout(0) << g_conf->name << " does not exist in monmap, will attempt to join an existing cluster" << dendl;
// parse a port, too!
p++;
int port = atoi(p);
+ if (port > MAX_PORT_NUMBER) {
+ return false;
+ }
set_port(port);
while (*p && *p >= '0' && *p <= '9')
p++;
#include "include/blobhash.h"
#include "include/encoding.h"
+#define MAX_PORT_NUMBER 65535
+
namespace ceph {
class Formatter;
}