]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2270] DHCPv4 parser fixes. Tests now pass.
authorTomek Mrugalski <tomasz@isc.org>
Fri, 12 Oct 2012 11:52:36 +0000 (13:52 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Fri, 12 Oct 2012 11:52:36 +0000 (13:52 +0200)
src/bin/dhcp4/config_parser.cc
src/bin/dhcp4/tests/config_parser_unittest.cc

index b7bc7de5bbbfade4c6ad9d7cf473cd5463fdff3f..f4e85f53f74635b7697831c11d618f2f05775705 100644 (file)
@@ -399,7 +399,7 @@ public:
             pos = txt.find("-");
             if (pos != string::npos) {
                 // using min-max notation
-                IOAddress min(txt.substr(0,pos - 1));
+                IOAddress min(txt.substr(0,pos));
                 IOAddress max(txt.substr(pos + 1));
 
                 Pool4Ptr pool(new Pool4(min, max));
index d732a718266d9c9a24bd25eb2f77a21f4ba2b723..8a8873f0bcebd58cf4d5903a08dcf82df8d53f2b 100644 (file)
@@ -95,7 +95,6 @@ TEST_F(Dhcp4ParserTest, empty_subnet) {
 
     EXPECT_NO_THROW(status = configureDhcp4Server(*srv_,
                     Element::fromJSON("{ \"interface\": [ \"all\" ],"
-                                      "\"preferred-lifetime\": 3000,"
                                       "\"rebind-timer\": 2000, "
                                       "\"renew-timer\": 1000, "
                                       "\"subnet4\": [  ], "
@@ -181,7 +180,6 @@ TEST_F(Dhcp4ParserTest, pool_out_of_subnet) {
     ConstElementPtr status;
 
     string config = "{ \"interface\": [ \"all\" ],"
-        "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "