Opened 2 years ago

Closed 21 months ago

#5418 closed defect (fixed)

better error than bad lexical cast

Reported by: fdupont Owned by: tmark
Priority: low Milestone: Kea1.4-final
Component: configuration Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no


By accident I put a subnet with a double / (i.e. "subnet": ""). The error returned is subnet configuration failed: bad lexical cast: source type value could not be interpreted as target IMHO because boost::lexical_cast is used and boost does not return standard exceptions...


Change History (6)

comment:1 Changed 2 years ago by tomek

  • Component changed from Unclassified to configuration
  • Milestone changed from Kea-proposed to Kea1.4-final

comment:2 Changed 21 months ago by tmark

  • Owner set to tmark
  • Status changed from new to assigned

comment:3 Changed 21 months ago by tmark

  • Owner changed from tmark to Unassigned
  • Status changed from assigned to reviewing

In testing this one I discovered two things. First, we had very little in the way of tests for invalid values for subnet address/prefix combos. Second, the logic in SubnetConfigParser::createSubnet() actually did funny things with values larger than 256 (i.e uint8_t).

I improved the logic in parsing and added more testing under bin/dhcp<4/6>/tests. Not sure this needs a ChangeLog?.

Ready for review.

comment:4 Changed 21 months ago by fdupont

  • Owner changed from Unassigned to fdupont

comment:5 Changed 21 months ago by fdupont

  • Owner changed from fdupont to tmark

Reading the code it is fine. Running make check on my macOS new tests are fine: ready for merge.

comment:6 Changed 21 months ago by tmark

  • Resolution set to fixed
  • Status changed from reviewing to closed

Changes merged with git# f7be9769a608247ec86c315712166667bfcaf7fa

No ChangeLog? entry added.

ticket is complete.

Note: See TracTickets for help on using tickets.