|
|
@ -9112,16 +9112,21 @@ sub insert_or_update_network_interfaces |
|
|
|
# If we don't have a network interface UUID, try to look one up using the MAC address |
|
|
|
# If we don't have a network interface UUID, try to look one up using the MAC address |
|
|
|
if (not $network_interface_uuid) |
|
|
|
if (not $network_interface_uuid) |
|
|
|
{ |
|
|
|
{ |
|
|
|
# See if I know this NIC by referencing it's MAC and name. The name is needed because virtual |
|
|
|
# See if I know this NIC by referencing it's MAC (if not a vnet device), host_uuid and name. |
|
|
|
# devices can share the MAC with the real interface. |
|
|
|
# The name is needed because virtual devices can share the MAC with the real interface. |
|
|
|
my $query = " |
|
|
|
my $query = " |
|
|
|
SELECT |
|
|
|
SELECT |
|
|
|
network_interface_uuid |
|
|
|
network_interface_uuid |
|
|
|
FROM |
|
|
|
FROM |
|
|
|
network_interfaces |
|
|
|
network_interfaces |
|
|
|
WHERE |
|
|
|
WHERE "; |
|
|
|
|
|
|
|
if ($network_interface_name !~ /^vnet/) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$query .= " |
|
|
|
network_interface_mac_address = ".$anvil->Database->quote($network_interface_mac_address)." |
|
|
|
network_interface_mac_address = ".$anvil->Database->quote($network_interface_mac_address)." |
|
|
|
AND |
|
|
|
AND "; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$query .= " |
|
|
|
network_interface_name = ".$anvil->Database->quote($network_interface_name)." |
|
|
|
network_interface_name = ".$anvil->Database->quote($network_interface_name)." |
|
|
|
AND |
|
|
|
AND |
|
|
|
network_interface_host_uuid = ".$anvil->Database->quote($network_interface_host_uuid)." |
|
|
|
network_interface_host_uuid = ".$anvil->Database->quote($network_interface_host_uuid)." |
|
|
|