use smart pointer to avoid memory issue
This commit is contained in:
parent
9c413c0edd
commit
a0060c8fa8
5 changed files with 21 additions and 19 deletions
|
@ -50,11 +50,11 @@ void packet_wol_handler(
|
|||
// TODO(Faraphel): check the 16 repetitions of the source address ?
|
||||
|
||||
// find the machine with the mac address
|
||||
for (const gns::GnsNode& node : gnsServer->getNodes())
|
||||
for (const gns::GnsPort& port : node.getPorts())
|
||||
for (const std::shared_ptr<gns::GnsNode>& node : gnsServer->getNodes())
|
||||
for (const gns::GnsPort& port : node->getPorts())
|
||||
if (port.mac_address == mac_address_target) {
|
||||
std::cout << "Matching node: " + node.getUuid() << std::endl;
|
||||
node.start();
|
||||
std::cout << "Matching node: " + node->getUuid() << std::endl;
|
||||
node->start();
|
||||
std::cout << "Node started." << std::endl;
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue