Allowed Addresspairs: Removing check for overlap with fixed ips

Current code does not allow assigning a fixed ip to a port when that ip
overlaps with one of the addresses in the allowed-addresspairs list.
This is an unnecessary check as the overlap does not have any negative
effect. Further, such a check actually makes it hard to use this
API. For example, if a fixed IP 10.10.1.1 exists on a port and we
want to allow addresses in 10.10.1.0/24 cidr on that port, then one
has to configure a list of 8 cidrs ([10.10.1.0/32, 10.10.1.2/31,
10.10.1.4/30, ..., 10.10.1.128/25]) on the allowed-addresspairs.
In addition to the above reasons, the current code also does not
check for the overlaps in all cases.

This patch summarily removes this overlap check.

Closes-Bug: #1321864
Change-Id: I5498c4a72b31267644da10a54a9860c1fc3bb250
This commit is contained in:
Praveen Yalagandula
2014-05-20 21:10:12 +00:00
parent ced29a894b
commit dc2895f4b9
7 changed files with 0 additions and 76 deletions

View File

@@ -669,7 +669,6 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
need_port_update_notify = False
session = context.session
changed_fixed_ips = 'fixed_ips' in port['port']
with session.begin(subtransactions=True):
try:
port_db = (session.query(models_v2.Port).
@@ -685,9 +684,6 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
self.update_address_pairs_on_port(context, id, port,
original_port,
updated_port))
elif changed_fixed_ips:
self._check_fixed_ips_and_address_pairs_no_overlap(
context, updated_port)
need_port_update_notify |= self.update_security_group_on_port(
context, id, port, original_port, updated_port)
network = self.get_network(context, original_port['network_id'])