]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Add index generation for IPv6 rules for DVR
authorrajeev <rajeev.grover@hp.com>
Wed, 12 Nov 2014 16:25:55 +0000 (11:25 -0500)
committerrajeev <rajeev.grover@hp.com>
Wed, 7 Jan 2015 21:57:57 +0000 (16:57 -0500)
commit7eb23f662cd62f29700ae51ee16dc535d251fc27
treee1b7c56cbe0305efc0ab25dfb76d2b8064afeed3
parentfcf0322c2a2608356378c3d56ab5ccaa34ad2f7a
Add index generation for IPv6 rules for DVR

For IPv6 support with DVR the index used for rule priority and
route table needs to be generated such that the index is 32 bits
or less but greater than the system generated rule entries.

For IPv4 the numeric value of the network is used as the index.
For IPv6 the 30 bit xor-folded crc32 of the cidr is used.
Values smaller than system generated entries are extended into
the range freed up because of xor-folding.
For code modularity, index generation is wrapped into a helper
method.

Partial-bug: #1376325

Change-Id: I4bcde80257ef5fe7c744086019841cdef5e3c60c
neutron/agent/l3/dvr.py
neutron/tests/unit/test_l3_agent.py