From 552657fff4e4538628e7d2b98c4fbe93a07d307c Mon Sep 17 00:00:00 2001 From: Tomek Mrugalski Date: Fri, 12 Oct 2012 13:52:36 +0200 Subject: [PATCH] [2270] DHCPv4 parser fixes. Tests now pass. --- src/bin/dhcp4/config_parser.cc | 2 +- src/bin/dhcp4/tests/config_parser_unittest.cc | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/bin/dhcp4/config_parser.cc b/src/bin/dhcp4/config_parser.cc index b7bc7de5bb..f4e85f53f7 100644 --- a/src/bin/dhcp4/config_parser.cc +++ b/src/bin/dhcp4/config_parser.cc @@ -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)); diff --git a/src/bin/dhcp4/tests/config_parser_unittest.cc b/src/bin/dhcp4/tests/config_parser_unittest.cc index d732a71826..8a8873f0bc 100644 --- a/src/bin/dhcp4/tests/config_parser_unittest.cc +++ b/src/bin/dhcp4/tests/config_parser_unittest.cc @@ -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\": [ { "