From dede7fe07e86b71db0f45e308e7e9f8a344f8b63 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Sat, 2 Mar 2019 20:22:07 +0100 Subject: [PATCH] [492-cb-subnet-merge-vs-duplicate-subnet-prefixes] Added comments about corner cases leading to problems --- src/lib/dhcpsrv/cfg_subnets4.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 -- 2.47.2