[ovs-git] [ovn-org/ovn] 24528a: northd: Fix IPAM IPv4 start address calculation.
noreply at github.com
Wed Jun 10 06:30:25 UTC 2020
Author: Mark Michelson <mmichels at redhat.com>
Date: 2020-06-10 (Wed, 10 Jun 2020)
northd: Fix IPAM IPv4 start address calculation.
IPAM assumes the other_config:subnet of the logical switch is a network
address, which can result in unusual address assignments.
As an example, consider the following configuration:
ovn-nbctl set logical_switch ls other_config:subnet=172.16.1.254/29
172.16.1.254 is not a network address of a /29 network, but ovn-northd
doesn't care. ovn-northd starts IP address allocation at 172.16.1.254, with 7
assignable addresses in the subnet. The first address (172.16.1.255) is
reserved for router port use. The first IP addresses to a logical switch
port is 172.16.2.0, then 172.16.2.1, and so on.
This patch changes the behavior by using the provided netmask to change
the starting IP address to the network address of the subnet. In the
previous example, the provided 172.16.1.254/29 would be converted
internally to 172.16.1.248/29 . Therefore, the first IP address
allocated to a switch port would be 172.16.1.250. Further allocations would
continue up until 172.16.1.254.
Reported at: https://bugzilla.redhat.com/show_bug.cgi?id=1823287
Acked-by: Numan Siddique <numans at ovn.org>
Signed-off-by: Mark Michelson <mmichels at redhat.com>
Signed-off-by: Numan Siddique <numans at ovn.org>
More information about the git