Interesting point.  Here is what I see:

[xenial]
ii  ieee-data       20150531.1   all          OUI and IAB listings
ii  python3-netaddr 0.7.18-1     all          manipulation of various common 
netwo
% python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import netaddr
>>> netaddr.EUI('00:22:59:11:22:33').oui.registration().org
'Guangzhou New Postcom Equipment Co.,Ltd.'


[zesty]
ii  ieee-data         20160613.1    all           OUI and IAB listings
ii  python3-netaddr   0.7.18-2      all           manipulation of various 
common network 
% python3
Python 3.5.2+ (default, Dec 13 2016, 14:16:35) 
[GCC 6.2.1 20161212] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import netaddr
>>> netaddr.EUI('00:22:59:11:22:33').oui.registration().org
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/netaddr/eui/__init__.py", line 478, in 
oui
    return OUI(self.value >> 24)
  File "/usr/lib/python3/dist-packages/netaddr/eui/__init__.py", line 98, in 
__init__
    self._parse_data(data, offset, size)
  File "/usr/lib/python3/dist-packages/netaddr/eui/__init__.py", line 145, in 
_parse_data
    record['org'] = line.split(None, 2)[2]
IndexError: list index out of range
>>> 

That is netaddr is not sufficiently hardened against the newer ieee-
data.  While it's conceivable that the actual bug is in ieee-data, it
would seem that hardening the code to better deal with it would be good.

The entry that breaks reads:
00-22-59   (hex)                Guangzhou New Postcom Equipment Co.,Ltd.
002259     (base 16)            Guangzhou New Postcom Equipment Co.,Ltd.
                                No.3¡¡Guangpuxi Road,Guangzhou Science 
City,
                                Guangzhou  Guangdong  510663
                                CN
while the same entry in the working file is:
  00-22-59   (hex)              Guangzhou New Postcom Equipment Co.,Ltd.
  002259     (base 16)          Guangzhou New Postcom Equipment Co.,Ltd.
                                No.3¡¡Guangpuxi Road,Guangzhou Science 
City,
                                Guangzhou Guangdong 510663
                                CHINA
(Note the leading pair of spaces...)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1655049

Title:
  [2.1] netaddr raises IndexError when looking up some OUI registrations

To manage notifications about this bug go to:
https://bugs.launchpad.net/maas/+bug/1655049/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to