More fun with dupes

This commit is contained in:
Grant Limberg 2020-03-03 23:52:53 -08:00
parent e702942041
commit f6026f94a5
No known key found for this signature in database
GPG key ID: 2BA62CCABBB4095A
2 changed files with 10 additions and 5 deletions

View file

@ -530,7 +530,12 @@ void PostgreSQL::initializeMembers(PGconn *conn)
int n = PQntuples(r2);
for (int j = 0; j < n; ++j) {
config["ipAssignments"].push_back(PQgetvalue(r2, j, 0));
std::string ipaddr = PQgetvalue(r2, j, 0);
std::size_t pos = ipaddr.find('/');
if (pos != std::string::npos) {
ipaddr = ipaddr.substr(0, pos);
}
config["ipAssignments"].push_back(ipaddr);
}
_memberChanged(empty, config, false);