Netaddr can't check IPv6 subnets for overlap

Bug #1364166 reported by Sagi (Sergey) Shnaidman
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Sagi (Sergey) Shnaidman

Bug Description

Because of bug of netaddr: https://github.com/drkjam/netaddr/issues/69
netaddr can not check overlapping of IPv6 subnets:
https://github.com/openstack/neutron/blob/master/neutron/db/db_base_plugin_v2.py#L572

Netaddr of version higher than 0.7.12 should be used.

Traceback:

DEBUG neutron.api.v2.base [req-98c7e546-5dfa-488e-bf99-ac8c6d11b45e None] Request body: {u'subnet': {u'ip_version': 6, u'network_id': u'49a71376-b484-481f-a1ee-e2f3c3daca67', u'cidr': u'2003::/64', u'gateway_ip': u'2003::1'}} prepare_request_body /opt/stack/new/neutron/neutron/api/v2/base.py:578
 598 ERROR neutron.api.v2.resource [req-98c7e546-5dfa-488e-bf99-ac8c6d11b45e None] create failed
Traceback (most recent call last):
  File "/opt/stack/new/neutron/neutron/api/v2/resource.py", line 87, in resource
    result = method(request=request, **args)
  File "/opt/stack/new/neutron/neutron/api/v2/base.py", line 448, in create
    obj = obj_creator(request.context, **kwargs)
  File "/opt/stack/new/neutron/neutron/plugins/ml2/plugin.py", line 660, in create_subnet
    result = super(Ml2Plugin, self).create_subnet(context, subnet)
  File "/opt/stack/new/neutron/neutron/db/db_base_plugin_v2.py", line 1054, in create_subnet
    self._validate_subnet_cidr(context, network, s['cidr'])
  File "/opt/stack/new/neutron/neutron/db/db_base_plugin_v2.py", line 572, in _validate_subnet_cidr
    if (netaddr.IPSet([subnet.cidr]) & new_subnet_ipset):
  File "/usr/lib/python2.7/dist-packages/netaddr/ip/sets.py", line 520, in __len__
    "IP addresses! Use the .size property instead." % _sys_maxint)
IndexError: range contains greater than 9223372036854775807 (maxint) IP addresses! Use the .size property instead.
 598 TRACE neutron.api.v2.resource
 598 INFO neutron.wsgi [req-98c7e546-5dfa-488e-bf99-ac8c6d11b45e None] 127.0.0.1 - - [01/Sep/2014 12:56:01] "POST /v2.0/subnets HTTP/1.1" 500 378 0.080822
 (598) accepted ('127.0.0.1', 59222)

Tags: ipv6
Revision history for this message
Sagi (Sergey) Shnaidman (sshnaidm) wrote :

I hope I submit patch to the right place:
https://review.openstack.org/#/c/118224/

Revision history for this message
Henry Gessau (gessau) wrote :

Sergey, you have submitted the correct fix to the correct place. Not sure why the patch did not get linked to this bug. Please assign it to yourself and mark it as in-progress.

Changed in neutron:
status: New → Confirmed
Revision history for this message
Sagi (Sergey) Shnaidman (sshnaidm) wrote :

Done. Maybe because it's different project (not "neutron", but "requirements")

Changed in neutron:
assignee: nobody → Sergey Shnaidman (sshnaidm)
status: Confirmed → In Progress
Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
Sagi (Sergey) Shnaidman (sshnaidm) wrote :
Revision history for this message
Henry Gessau (gessau) wrote :

Sergey, just a clarification on the status:
The fix has been committed to global requirements, but not yet to neutron.
The (automatically) proposed patch to neutron is here --> https://review.openstack.org/117949
When that is merged, you can set the status to "Fix committed".
The status will be set to "Fix released" by the release manager when Juno is released.

Changed in neutron:
status: Fix Released → In Progress
Changed in neutron:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in neutron:
milestone: none → juno-rc1
importance: Undecided → Medium
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-rc1 → 2014.2
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.