IndexError: Index out of range error is observed for creating multiple networks with CIDR_v6
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Jason Kölker |
Bug Description
I am trying to run up a unit test that tries to create multiple (>1) networks having an IPv6 CIDR.
While doing so, it raises "IndexError: index out range for address range size!".
This specific use case is in module nova.network.
Parameter values: num_networks = 2 (or more) and arbitrary value for cidr_v6 (say 2001:db8::/64)
Trunk Revision: 1370
Traceback (most recent call last):
File "/home/
vpn_start=9999)
File "/home/
cidr_v6 = '%s/%s' % (fixed_
File "/usr/lib/
raise IndexError('index out range for address range size!')
IndexError: index out range for address range size!
I think the list is trying to subscript a very large integer index.
line #624: network_size_v6 = 1 << 64 (which is equal to 184467440737095
While calculating start_v6 = index * network_size_v6 , For index = 1 , start_v6 = 184467440737095
hence fixed_net_
Related branches
- Matt Dietz (community): Approve
- Josh Kearney (community): Approve
-
Diff: 457 lines (+134/-116)5 files modifiedbin/nova-manage (+4/-1)
nova/compute/manager.py (+2/-1)
nova/network/manager.py (+81/-86)
nova/tests/test_network.py (+45/-27)
nova/virt/libvirt/connection.py (+2/-1)
Changed in nova: | |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in nova: | |
status: | In Progress → Fix Committed |
Changed in nova: | |
milestone: | none → diablo-4 |
Changed in nova: | |
milestone: | diablo-4 → 2011.3 |
status: | Fix Committed → Fix Released |
This will be fixed with my new create_networks I'm working on for this other bug. It will use netaddr's built in subnetting/ iterating.