glpi-project / glpi

GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.
https://glpi-project.org
GNU General Public License v3.0
4.01k stars 1.26k forks source link

Multiple MAC addresses create one hub even though it's a network equipment #17459

Open TITIxplod opened 1 week ago

TITIxplod commented 1 week ago

Code of Conduct

Is there an existing issue for this?

Version

10.0.12

Bug description

Hello, Although a MAC address corresponds to a network device declared in GLPI (after object conversion), the inventory continues to create a hub. There seems to be an error at line 363 in file \src\Inventory\Asset\NetworkPort.php to handle this case: if (isset($this->connections['NetworkEquipment'])) { instead of if (isset($this->connection_ports['NetworkEquipment'])) { Thanks.

Relevant log output

No response

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

No response

Anything else?

No response

trasher commented 1 week ago

First try with latest release. And the if you do, please provide all details and files so we can reproduce easily on a fresh install.

TITIxplod commented 4 days ago

Hi there, The same issue appears on a fresh install of GLPI 10.0.16... Steps to reproduce

hub_creation

But in fact, we know the first equipment is an access point, so we convert it to a network equipment, then we delete unmanaged equipments equipment_conversion

After, we import the same XML: hub_creation_issue However, there's now a known network equipement on port1.0.5, so it should not create a hub according to the code:

if (count($found_macs) > 1) { // MultipleMac
           //do not manage MAC addresses if we found one NetworkEquipment
            if (isset($this->connections['NetworkEquipment'])) {
                return;
            }

So I think there is an error: it should be $this->connection_ports['NetworkEquipment'] in order to obtain this result:

ok

Thanks.