subnet CIDR validation broken for non-root CIDRs again

Bug #1204173 reported by Jay Bryant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Kevin Benton

Bug Description

Earlier this month a fix was released to allow non-root CIDRs to be entered. The fix was for bug 1188845. It was approved and merged. Now, however, the functionality has been reversed by commit 53a66b299f18a7184972502b43441a5ad7b050fd (bug 1195974) which checks the input earlier in the path and rejects anything but the root CIDR.

I am unable to find documentation that says you cannot use a non-root (I.E. X.X.X.254) IP to specify a subnet. With an IP and subnet mask it is possible to create a network and determine the root for the subnet.

Revision history for this message
yong sheng gong (gongysh) wrote :

Do u have the case where the subnet is non-root?

Changed in neutron:
status: New → Incomplete
Revision history for this message
Jay Bryant (jsbryant) wrote :

Yong Sheng,

As I put in bug 118845, we have a customer that uses a non-root CIDR frequently. They are sent an IP address and they want to create a new subnet or that IP. The address sent in is not always the root. What they had done in scripting in the past was to just use the IP they were sent, I.E. 10.0.2.10/24 with the CIDR to create the subnet.

I had gotten this working and approved earlier in the month but now the change you committed nullifies that change.

Changed in neutron:
status: Incomplete → New
Revision history for this message
ZhiQiang Fan (aji-zqfan) wrote :

i suggest that for a certain change, you'd better write good enough test code, this can avoid unexpected refactor or later change, since they will not pass the unittest for your case

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

Jay, it looks like bug 118845 is erroneously referenced in this report. Could you provide the right one?

Changed in neutron:
status: New → Incomplete
Revision history for this message
James Carey (jecarey) wrote :
Changed in neutron:
status: Incomplete → New
Sandhya Dasu (sadasu)
Changed in neutron:
assignee: nobody → Sandhya Dasu (sadasu)
Revision history for this message
James Carey (jecarey) wrote :

I saw that you took this. I have a user that is running into this asking me about it. Do you have some info on how you are planning to solve this you could share with me?

Sandhya Dasu (sadasu)
Changed in neutron:
assignee: Sandhya Dasu (sadasu) → nobody
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/81137

Changed in neutron:
assignee: nobody → Kevin Benton (kevinbenton)
status: New → In Progress
Revision history for this message
Kevin Benton (kevinbenton) wrote :

I think it's valid for a user to put whatever they want in the masked portion of a CIDR. This becomes particularly useful if you are dealing with small boundary subnets that don't end with nice decimal zeros.

I don't see the advantage of putting the user through the pain of performing the masking operation when neutron is already doing it using the netaddr library. :-)

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

Reviewed: https://review.openstack.org/81137
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=39c04fdc2c94b8ee48600f3148c5f850645b7c4e
Submitter: Jenkins
Branch: master

commit 39c04fdc2c94b8ee48600f3148c5f850645b7c4e
Author: Kevin Benton <email address hidden>
Date: Mon Mar 17 17:06:46 2014 -0700

    Allow CIDRs with non-zero masked portions

    Allow users to specify CIDRs with bits other
    than zeros in the masked portion of the subnet.
    e.g. 192.168.1.5/24 is accepted and converted
    to 192.168.1.0/24.

    Closes-Bug: #1204173
    Change-Id: I7ddff41e6988feb6e2a87e40a4d99db7174415b1

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