1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Bug #2045: wrap around the vnc port number

(cherry picked from commit 005aa35739ac1b2ebe8646fc21283e75b8b5f785)
This commit is contained in:
Carlos Martín 2013-08-01 16:25:49 +02:00 committed by Javi Fontan
parent e27a5b9a7e
commit 7d128316f5

View File

@ -909,11 +909,13 @@ void VirtualMachine::parse_graphics()
int base_port;
string base_port_s;
int limit = 65535;
nd.get_configuration_attribute("VNC_BASE_PORT",base_port_s);
iss.str(base_port_s);
iss >> base_port;
oss << ( base_port + oid );
oss << ( base_port + ( oid % (limit - base_port) ));
graphics->replace("PORT", oss.str());
}
}