IPAddress() macro only provides 39 characters where ipv6 cidr could be 43 characters

Bug #1127696 reported by Morgan Fainberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Morgan Fainberg

Bug Description

The IPAddress() Macro in nova/db/sqlalchemy/types.py only provides a column with 39 characters. In theory if someone provided a complete IPv6 address and a 3-digit CIDR mask it wouldn't fit in the 39 characters. security_group_rules "cidr" column was truncated to 39 characters in db revision 149 as well.

The determination should be made if the use of a complete IPv6 address and a CIDR mask should be supported. If so should the IPAddress() macro should be used or should a new CIDR() macro should be created.

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

Can we at least log an error when this happens with grizzly?

Changed in nova:
assignee: nobody → Mauro Sergio Martins Rodrigues (maurosr)
status: New → Confirmed
importance: Undecided → High
Changed in nova:
assignee: Mauro Sergio Martins Rodrigues (maurosr) → Sean Dague (sdague-b)
status: Confirmed → In Progress
Changed in nova:
assignee: Sean Dague (sdague-b) → Morgan Fainberg (mdrnstm)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/22238
Committed: http://github.com/openstack/nova/commit/30c2a8f66edb9f9601a519fb525a46cc4486ab2a
Submitter: Jenkins
Branch: master

commit 30c2a8f66edb9f9601a519fb525a46cc4486ab2a
Author: Sean Dague <email address hidden>
Date: Mon Feb 18 15:50:36 2013 -0500

    create new cidr type for data storage

    it turns out that the 149 migration was overly agressive in its
    IPAddress conversion, as we actually have a few columns that are
    really CIDR values. This means that 39 chars isn't enough space to
    store even a normalized IPv6 cidr in the worst case (you need 4
    more to support /127).

    We must also normalize IPv6 address cidrs otherwise 43 chars isn't
    long enough. This was more of a problem in theory, than in practice,
    as real IPv6 addresses rarely are non compressible.

    This adds a migration to bump up the CIDR columns to 43 characters.
    There is an infinitessimal chance that someone using mysql and long
    IPv6 values might loose data in 149 because of truncation. This
    doesn't address that, which would require modifying 149.

    The native pg CIDR column type is not used because it would require
    additional scrubbing of the data as CIDR is invalid if any host bits
    are set (and it will fail on type conversion).

    Fixes bug #1127696

    Change-Id: I54539ac9c257d726bc4db5943169b5284cc847d3

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-3 → 2013.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.