On 2022-07-17 20:40, Jonathon Reinhart wrote:

OUI lookups are returning incorrect / corrupt results. Take for
example OUI F4-6D-04.

The data in ieee-data is correct:

     F4-6D-04   (hex)        ASUSTek COMPUTER INC.
     F46D04     (base 16)        ASUSTek COMPUTER INC.
                     15,Li-Te Rd.,Peitou,
                     Taipei    112
                     TW

But using the OUI object I get completely incorrect / corrupt results:

     >>> oui = OUI('F4-6D-04')
     >>> oui
     OUI('F4-6D-04')
     >>> oui.registration()
     {'address': [')\t\tCisco Systems, Inc',
                 '80 West Tasman Drive',
                 'San Jose  CA  94568',
                 'US'],
     'idx': 16018692,
     'offset': 821392,
     'org': 'eero inc.',
     'oui': 'F4-6D-04',
     'size': 141}

I suspect that the reason is because this debian package replaces
netaddr/eui/oui.txt with a symlink to /var/lib/ieee-data/oui.txt but
**does not** update the corresponding oui.idx. Thus, the indices are
stale.

This Debian package likely needs to re-generate the indices before shipping.

It's already the case. However, the file can change unexpectedly (for example, when the user is running update-ieee-data). It seems that update-ieee-data will execute hooks in /var/lib/ieee-data/update.d. We could install such a hook. But, we would also need to add a symlink for the indexes to a directory controlled by the netaddr package.

If you want to try to do that, you are welcome to submit a patch.

In the meantime, you can run python3 /usr/lib/python3/dist-packages/netaddr/eui/ieee.py as root to fix the issue. This is not really "clean" (as you erase package-owned data), but it would work.

Reply via email to