[2.5] get_source_address() raises StopIteration if a /128 IPv6 network is passed in

Bug #1789721 reported by Mike Pontillo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Mike Pontillo
2.3
Fix Committed
High
Mike Pontillo
2.4
Fix Committed
Critical
Mike Pontillo

Bug Description

This Python console session shows the issue:

>>> from netaddr import IPNetwork
>>> def f(ipn):
... return next(ipn.iter_hosts())
...
>>> f(IPNetwork('127.0.0.1/8'))
IPAddress('127.0.0.1')
>>> f(IPNetwork('127.0.0.1/32'))
IPAddress('127.0.0.1')
>>> f(IPNetwork('fe80::1/64'))
IPAddress('fe80::1')
>>> f(IPNetwork('fe80::1/128'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in f
StopIteration

This leads to errors in MAAS such as the following:

https://paste.ubuntu.com/p/D9zKJcb8qK/

Related branches

Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
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.