Open devibinoy opened 1 week ago
The logic is done in match_variable: https://github.com/clicon/cligen/blob/68a0b407f5c4e1fd81191ad1eb8be5fe640ad03d/cligen_match.c#L92 It has to do with split functionality in the parse and validate functions making the range checks unnecessary complex. One way to fix it could to add explicit range checks in the parse function.
set instance default protocol bgp timer keepalive 99999999999999999999 CLI syntax error: "set instance default protocol bgp timer keepalive 99999999999999999999": Number 99999999999999999999 out of data-type range: 0 - 18446744073709551615
set instance default protocol bgp timer keepalive 99999
CLI syntax error: "set instance default protocol bgp timer keepalive 99999": Number 99999 out of data-type range: 0 - 65535
Here, keepalive is of type uint16. The logic parses the input first as a broader type (uint64), and then as the specific type (uint16). However, the error messages are inconsistent between these stages for the same context.