yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #86286
[Bug 1580927] Re: spans beyond the subnet reported incorrectly in ipam
Reviewed: https://review.opendev.org/c/openstack/neutron/+/318542
Committed: https://opendev.org/openstack/neutron/commit/437a311eca27bde5799b04d6a27d8e0e2aaf1c1f
Submitter: "Zuul (22348)"
Branch: master
commit 437a311eca27bde5799b04d6a27d8e0e2aaf1c1f
Author: Nurmatov Mamatisa <nurmatov.mamatisa@xxxxxxxxxx>
Date: Thu Feb 25 21:19:17 2021 +0300
Using 31-Bit and 32-Bit prefixes for IPv4 reasonably
When needing to create a point to point connection via a subnet,
generally and /31 is the recommended cidr. Neutron supports /31
disabling dhcp and gateway on a subnet. /32 is also supported in
openstack.
Closes-Bug: #1580927
Change-Id: I3bfa3efb9fb8076656b16c89d2f35d74efde12b7
** Changed in: neutron
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1580927
Title:
spans beyond the subnet reported incorrectly in ipam
Status in neutron:
Fix Released
Bug description:
summary: When needing to create a point to point connection via a
subnet, generally and /31 is the recommended cidr. Neutron supports
/31 via disabling dhcp and gateway on a subnet. However, IPam does
not provide the allocation pool of the subnet properly and a VM cannot
be created.
Steps to reproduce
root@ubuntu:~# neutron subnet-create --disable-dhcp --no-gateway --cidr=10.14.0.20/31 --name bug-subnet 69c5342a-5526-4257-880a-f8fd2e633de9
Created a new subnet:
+-------------------+--------------------------------------+
| Field | Value |
+-------------------+--------------------------------------+
| allocation_pools | |
| cidr | 10.14.0.20/31 |
| dns_nameservers | |
| enable_dhcp | False |
| gateway_ip | |
| host_routes | |
| id | 63ce4e26-9838-4fa3-b2d5-e59f88f5b7ce |
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | bug-subnet |
| network_id | 69c5342a-5526-4257-880a-f8fd2e633de9 |
| subnetpool_id | |
| tenant_id | ca02fc470acc4a27b468dff32ee850b2 |
+-------------------+--------------------------------------+
root@ubuntu:~# neutron subnet-update --allocation-pool start=10.14.0.20,end=10.14.0.21 bug-subnet
The allocation pool 10.14.0.20-10.14.0.21 spans beyond the subnet cidr 10.14.0.20/31.
Recommended Fix:
in db/ipam_backend_mixin.py :: function: validate_allocation_pools
~~lines: 276
if start_ip < subnet_first_ip or end_ip > subnet_last_ip:
LOG.info(_LI("Found pool larger than subnet "
"CIDR:%(start)s - %(end)s"),
{'start': start_ip, 'end': end_ip})
raise n_exc.OutOfBoundsAllocationPool(
pool=ip_pool,
subnet_cidr=subnet_cidr)
This if block should have a special case for ipv4 /31 and /32 for "<= and >=" :
start_ip <= subnet_first_ip or end_ip >= subnet_last_ip
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1580927/+subscriptions
References