From: Francis Dupont Date: Sat, 2 Mar 2019 19:22:07 +0000 (+0100) Subject: [492-cb-subnet-merge-vs-duplicate-subnet-prefixes] Added comments about corner cases... X-Git-Tag: Kea-1.6.0-beta~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dede7fe07e86b71db0f45e308e7e9f8a344f8b63;p=thirdparty%2Fkea.git [492-cb-subnet-merge-vs-duplicate-subnet-prefixes] Added comments about corner cases leading to problems --- diff --git a/src/lib/dhcpsrv/cfg_subnets4.cc b/src/lib/dhcpsrv/cfg_subnets4.cc index 1eb24fe70d..957a2c33e9 100644 --- a/src/lib/dhcpsrv/cfg_subnets4.cc +++ b/src/lib/dhcpsrv/cfg_subnets4.cc @@ -111,6 +111,10 @@ CfgSubnets4::merge(CfgOptionDefPtr cfg_def, CfgSharedNetworks4Ptr networks, continue; } + // Updating the prefix can lead to problems... e.g. pools + // and reservations going outside range. + // @todo: check prefix change. + // We're going to replace the existing subnet with the other // version. If it belongs to a shared network, we need // remove it from that network. @@ -131,11 +135,9 @@ CfgSubnets4::merge(CfgOptionDefPtr cfg_def, CfgSharedNetworks4Ptr networks, // Subnet found. auto existing_subnet = *subnet_prefix_it; - // If the existing subnet and other subnet - // are the same instance skip it. - if (existing_subnet == *other_subnet) { - continue; - } + // Updating the id can lead to problems... e.g. reservation + // for the previous subnet ID. + // @todo: check reservations // We're going to replace the existing subnet with the other // version. If it belongs to a shared network, we need