Parcourir la source

[5122] One more fix for printing out position

Tomek Mrugalski il y a 8 ans
Parent
commit
71b42640f7
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      src/lib/dhcpsrv/parsers/dhcp_parsers.cc

+ 3 - 1
src/lib/dhcpsrv/parsers/dhcp_parsers.cc

@@ -1048,9 +1048,11 @@ SubnetConfigParser::createSubnet(ConstElementPtr params) {
         subnet_->setHostReservationMode(hrModeFromText(hr_mode));
         subnet_->setHostReservationMode(hrModeFromText(hr_mode));
     } catch (const BadValue& ex) {
     } catch (const BadValue& ex) {
         ConstElementPtr mode = params->get("reservation-mode");
         ConstElementPtr mode = params->get("reservation-mode");
-        string pos("[missing]");
+        string pos;
         if (mode) {
         if (mode) {
             pos = mode->getPosition().str();
             pos = mode->getPosition().str();
+        } else {
+            pos = params->getPosition().str();
         }
         }
         isc_throw(DhcpConfigError, "Failed to process specified value "
         isc_throw(DhcpConfigError, "Failed to process specified value "
                   " of reservation-mode parameter: " << ex.what()
                   " of reservation-mode parameter: " << ex.what()