Skip to content

Commit

Permalink
Fix add network ip
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmr committed Dec 17, 2024
1 parent 189cf7f commit aaf8123
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions inc/networkport.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,22 @@ static private function updateNetworkPort($mac, $name, $computers_id, $instantia
}
}

if ($ips) {
foreach ($ips as $ip) {
$ip_input = ['name' => $ip,
'itemtype' => 'NetworkName',
'items_id' => $networknames_id,
'_no_history' => !$install_network_history,
'is_dynamic' => 1,
'is_deleted' => 0];
$ip_address->add($ip_input);
}
}

return $network_port->getID();
if ($ips) {
foreach ($ips as $ip) {
$ip_address = new IPAddress();
$ip_input = [
'name' => $ip,
'itemtype' => 'NetworkName',
'items_id' => $networknames_id,
'_no_history' => !$install_network_history,
'is_dynamic' => 1,
'is_deleted' => 0
];
$ip_address->add($ip_input);
}
}

return $network_port->getID();
}

// importNetwork
Expand Down

0 comments on commit aaf8123

Please sign in to comment.