Subnet creation from a subnet pool can get wrong ip_version

Bug #1444146 reported by Carl Baldwin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Carl Baldwin
Kilo
New
Undecided
Unassigned
python-neutronclient
Fix Released
Medium
Akihiro Motoki

Bug Description

The following command ends up creating a subnet with ip_version set to 4 even though the pool is an ipv6 pool.

  $ neutron subnet-create --subnetpool ext-subnet-pool --prefixlen 64 network1

Revision history for this message
Carl Baldwin (carl-baldwin) wrote :

This bug seems to be partly the fault of the server and partly the fault of the client. The client makes the following request:

curl -g -i --cacert "/opt/stack/data/CA/int-ca/ca-chain.pem" -X POST http://10.224.36.25:9696/v2.0/subnets.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}0c42f92608a907852b66070c2776d291f4a07ae4" -d '{"subnet": {"network_id": "2763a726-7ae5-407a-a2d5-1b0852f3612d", "ip_version": 4, "prefixlen": "64", "subnetpool_id": "f1918793-620a-4fb2-bc01-9962623326e8"}}'

The ip_version is set incorrectly by the client and the server incorrectly accepts it.

Changed in neutron:
assignee: nobody → Carl Baldwin (carl-baldwin)
status: New → Confirmed
Revision history for this message
Carl Baldwin (carl-baldwin) wrote :

Here is the subnet pool

$ neutron subnetpool-show ext-subnet-pool
+-------------------+--------------------------------------+
| Field | Value |
+-------------------+--------------------------------------+
| default_prefixlen | 64 |
| default_quota | |
| id | f1918793-620a-4fb2-bc01-9962623326e8 |
| ip_version | 6 |
| max_prefixlen | 128 |
| min_prefixlen | 64 |
| name | ext-subnet-pool |
| prefixes | 2001:db8:1:2::/63 |
| | 2001:db8:2:2::/63 |
| shared | True |
| tenant_id | e7472a966fd544afaef764a85cf24ab5 |
+-------------------+--------------------------------------+

Changed in neutron:
assignee: Carl Baldwin (carl-baldwin) → Ryan Tidwell (ryan-tidwell)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/173594

Changed in neutron:
status: Confirmed → In Progress
Changed in neutron:
importance: Undecided → High
Kyle Mestery (mestery)
Changed in neutron:
milestone: none → liberty-1
tags: added: kilo-rc-potential
Changed in neutron:
assignee: Ryan Tidwell (ryan-tidwell) → Carl Baldwin (carl-baldwin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/173594
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=615102520c0df3952347c3e176b60c0ddc97040b
Submitter: Jenkins
Branch: master

commit 615102520c0df3952347c3e176b60c0ddc97040b
Author: Ryan Tidwell <email address hidden>
Date: Tue Apr 14 15:53:02 2015 -0700

    Block subnet create with mismatched IP versions

    Change-Id: Ic0a3baf0e956505999d2473ae85ebac90e0970cd
    Closes-Bug: 1444146

Changed in neutron:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/177466

Revision history for this message
Kyle Mestery (mestery) wrote :

This is something that would be helpful to have in RC3.

Thierry Carrez (ttx)
tags: removed: kilo-rc-potential
tags: added: kilo-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (neutron-pecan)

Fix proposed to branch: neutron-pecan
Review: https://review.openstack.org/185072

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/kilo)

Reviewed: https://review.openstack.org/177466
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=8c311072b7bd7b4e2f5d2ce4ffb8e0ee1e1c1809
Submitter: Jenkins
Branch: stable/kilo

commit 8c311072b7bd7b4e2f5d2ce4ffb8e0ee1e1c1809
Author: Ryan Tidwell <email address hidden>
Date: Tue Apr 14 15:53:02 2015 -0700

    Block subnet create with mismatched IP versions

    Cherry picked from 615102520c0df3952347c3e176b60c0ddc97040b

    Change-Id: Ic0a3baf0e956505999d2473ae85ebac90e0970cd
    Closes-Bug: 1444146

tags: added: in-stable-kilo
Revision history for this message
Carl Baldwin (carl-baldwin) wrote :

I just added python-neutronclient to this bug report. The fact that the client defaults to IP version 4 even when a version 6 subnet pool has been selected should be fixed.

Changed in python-neutronclient:
assignee: nobody → Sudipta Biswas (sbiswas7)
Changed in python-neutronclient:
status: New → In Progress
Akihiro Motoki (amotoki)
Changed in python-neutronclient:
importance: Undecided → High
importance: High → Medium
Revision history for this message
Carl Baldwin (carl-baldwin) wrote :

https://review.openstack.org/#/c/194078 was proposed for python-neutronclient

Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Changed in python-neutronclient:
assignee: Sudipta Biswas (sbiswas7) → Akihiro Motoki (amotoki)
Changed in python-neutronclient:
assignee: Akihiro Motoki (amotoki) → Sudipta Biswas (sbiswas7)
Changed in python-neutronclient:
assignee: Sudipta Biswas (sbiswas7) → Akihiro Motoki (amotoki)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-neutronclient (master)

Reviewed: https://review.openstack.org/194078
Committed: https://git.openstack.org/cgit/openstack/python-neutronclient/commit/?id=043656c8f8945b5c236bbd30b460f94e05a5a59d
Submitter: Jenkins
Branch: master

commit 043656c8f8945b5c236bbd30b460f94e05a5a59d
Author: Sudipta Biswas <email address hidden>
Date: Sat Jul 4 15:56:59 2015 +0900

    Determine ip version during subnet create.

    Currently, the default IP version for a subnet-create is IPv4.
    This behavior is wrong when we use a IPv6 subnetpool and
    do not specify the ip version explicitly during the subnet
    create operation.

    This fix proposes to make the neutron client code for subnet
    creation become aware of the subnetpool version. This ensures
    that the proper IP version is sent down to the neutron server
    if the subnet create is requested with a subnetpool.

    Co-Authored-By: Akihiro Motoki <email address hidden>

    Change-Id: I13da0f204e8ce335a2082c7d829bee28ac567c3f
    Closes-bug: 1444146

Changed in python-neutronclient:
status: In Progress → Fix Committed
Changed in python-neutronclient:
milestone: none → 3.0.0
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: liberty-1 → 7.0.0
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.