]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[4097a] Added a no subnet check in buildCfgOptionList()
authorFrancis Dupont <fdupont@isc.org>
Wed, 25 Nov 2015 10:27:55 +0000 (11:27 +0100)
committerFrancis Dupont <fdupont@isc.org>
Wed, 25 Nov 2015 10:27:55 +0000 (11:27 +0100)
src/bin/dhcp4/dhcp4_srv.cc

index 11decc3d3df5f29b23568d1941c28841a2112e92..878bcec58b45a3b2fcfeee5f6a58f599f2363170 100644 (file)
@@ -827,7 +827,12 @@ Dhcpv4Srv::buildCfgOptionList(Dhcpv4Exchange& ex) {
 
     // First subnet configured options
     Subnet4Ptr subnet = ex.getContext()->subnet_;
-    if (subnet && !subnet->getCfgOption()->empty()) {
+    if (!subnet) {
+        // All methods using the CfgOptionList object return soon when
+        // there is no subnet so do the same
+        return;
+    }
+    if (!subnet->getCfgOption()->empty()) {
         co_list.push_back(subnet->getCfgOption());
     }