Browse Source

[4097a] Added a no subnet check in buildCfgOptionList()

Francis Dupont 9 years ago
parent
commit
d40a3b4114
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/bin/dhcp4/dhcp4_srv.cc

+ 6 - 1
src/bin/dhcp4/dhcp4_srv.cc

@@ -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());
     }