Interface Detection Infiniband MAC wrong

Bug #1466746 reported by Maik Götte
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OCS Inventory: Unified Unix Agent
Fix Released
Low
Frank

Bug Description

Machines with infiniband adapters are all listed with identical MAC-adresses which is obviously a problem of the 20 byte hardware address of those adapters in contrast to the standard 8 byte address.
Interface detection, as far as I can see, is done bei "ifconfig" which, btw is deprecated. ifconfig truncates the hardware address to 8 byte even if it's an infiniband interface:

> ifconfig -a

Ifconfig uses the ioctl access method to get the full address information, which limits hardware addresses to 8 bytes.
Because Infiniband address has 20 bytes, only the first 8 bytes are displayed correctly.
Ifconfig is obsolete! For replacement check ip.
ib0 Link encap:InfiniBand HWaddr 80:00:00:48:FE:80:00:00:00:00:00:00:00:00:00:00:00:00:00:00
          inet addr:192.168.169.253 Bcast:192.168.171.255 Mask:255.255.252.0
          inet6 addr: fe80::225:90ff:ff16:67d5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:2044 Metric:1
          RX packets:6266 errors:0 dropped:0 overruns:0 frame:0
          TX packets:560 errors:0 dropped:7 overruns:0 carrier:0
          collisions:0 txqueuelen:256
          RX bytes:508192 (496.2 KiB) TX bytes:48468 (47.3 KiB)

> ip link show ib0
4: ib0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 2044 qdisc pfifo_fast state UP qlen 256
    link/infiniband 80:00:00:48:fe:80:00:00:00:00:00:00:00:25:90:ff:ff:16:67:d5 brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff

So I boldly suggest and humbly request rewriting the perl code for network interface detection using "ip". It looks like the database should be able to store the different sized MACs (varchar(255)) so it seems to "only" be the code

Regards,
Maik

Frank (frank-bourdeau)
Changed in ocsinventory-unix-agent:
assignee: nobody → Frank (frank-bourdeau)
importance: Undecided → Low
status: New → Fix Committed
Revision history for this message
Maik Götte (maik-goette) wrote :

I'm actually working on a fix.

Revision history for this message
Maik Götte (maik-goette) wrote :

patched files:
perl/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm
perl/Ocsinventory/Agent/Backend/OS/Linux/Network/IPv4.pm

Changed route and ifconfig to ip (addr / route) and iwconfig to iw.

Infiniband MAC ist now correctly shown in the database.

Wifi-Adaptes were not tested but the code should work as before (setting Type to Wifi).

The old code is commented in the files so the changes mad should be comprehensible.
It would be great if the fix could make it into the 2.2 version.

Best regards
Maik

Revision history for this message
Frank (frank-bourdeau) wrote :

Hi,

launchpad is no more used. OCS inventory project has moved to github.

Please open an issue here => https://github.com/OCSInventory-NG/UnixAgent

Regards

Frank

Frank (frank-bourdeau)
Changed in ocsinventory-unix-agent:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.