netaddr should optionally use ieee data in /var/lib instead of /usr/share

Bug #1717752 reported by zebul666
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-netaddr (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

netaddr python package uses 2 files oui.txt and iab.txt to make mac address look up and others.

However, the files

/usr/lib/python2.7/dist-packages/netaddr/eui/iab.txt
/usr/lib/python2.7/dist-packages/netaddr/eui/oui.txt

are symlinks to, respectively,
/usr/share/ieee-data/iab.txt
/usr/share/ieee-data/oui.txt

from the package ieee-data.

But if you update the files with update-ieee-data, the updated files lies in /var/lib/ieee-data and not in /usr/share/ieee-data

So the python package will continue to use the old ones.

The fix is simple. Use symlink towards
/var/lib/ieee-data/iab.txt
/var/lib/ieee-data/oui.txt
respectively instead

ProblemType: Bug
DistroRelease: Ubuntu 17.04
Package: python-netaddr 0.7.18-2
ProcVersionSignature: Ubuntu 4.10.0-33.37-generic 4.10.17
Uname: Linux 4.10.0-33-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.20.4-0ubuntu4.5
Architecture: amd64
CurrentDesktop: Unity:Unity7
Date: Sun Sep 17 09:48:33 2017
InstallationDate: Installed on 2016-05-22 (482 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
PackageArchitecture: all
SourcePackage: python-netaddr
UpgradeStatus: Upgraded to zesty on 2017-04-14 (155 days ago)

Revision history for this message
zebul666 (zebul666) wrote :
Revision history for this message
zebul666 (zebul666) wrote :

But what I describe above is not enough. Because netaddr module use index files, generated from oui.txt and iab.txt

So you need also to update those index files otherwise the mac vendor look up will be broken.

So I created symlinks in /usr/lib/python2.7/dist-packages/netaddr/eui for oui.idx and iab.idx towards /var/lib/ieee-data/oui.idx and /var/lib/ieee-data/iab.idx respectivelly.

Then used that python script to regenerate the index files

from netaddr.eui import ieee
ouiidx = ieee.FileIndexer('oui.idx')
oui = ieee.OUIIndexParser('oui.txt')
oui.attach(ouiidx)
oui.parse()
oui.detach(ouiidx)

iabidx = ieee.FileIndexer('iab.idx')
iab = ieee.IABIndexParser('iab.txt')
iab.attach(iabidx)
iab.parse()
iab.detach(iabidx)

I don't know how you could manage this at the package level ? But this is really needed

Revision history for this message
James Page (james-page) wrote :

You might like to forward this bug to Debian and/or the python-netaddr [0] project itself.

[0] https://github.com/drkjam/netaddr/

Changed in python-netaddr (Ubuntu):
status: New → Triaged
importance: Undecided → Wishlist
James Page (james-page)
summary: - netaddr should use symlink in /var/lib instead of /usr/share
+ netaddr should optionally use ieee data in /var/lib instead of
+ /usr/share
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.