[Xorp-hackers] [PATCH 3/4] xorp: rtrmgr: Enable reading of positive integers
igorm at etf.rs
igorm at etf.rs
Tue Mar 13 03:49:14 PDT 2012
From: Igor Maravic <igorm at etf.rs>
Positive integers are read as uint. Change type from NODE_UINT to NODE_INT so they could be read.
Signed-off-by: Igor Maravic <igorm at etf.rs>
---
xorp/rtrmgr/conf_tree.cc | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/xorp/rtrmgr/conf_tree.cc b/xorp/rtrmgr/conf_tree.cc
index 77cd3b9..f74430c 100644
--- a/xorp/rtrmgr/conf_tree.cc
+++ b/xorp/rtrmgr/conf_tree.cc
@@ -293,9 +293,13 @@ ConfigTree::terminal_value(const string& value, int type, ConfigOperator op)
* If ctn_type() == NODE_ULONG, then
* type will be NODE_UINT, because
* we read uint64 values just as uint values
+ *
+ * Other case is when we read positive integers
*/
if (ctn->type() == NODE_ULONG && type == NODE_UINT)
type = NODE_ULONG;
+ else if (ctn->type() == NODE_INT && type == NODE_UINT)
+ type = NODE_INT;
if ((ctn->type() == NODE_TEXT) && (type == NODE_TEXT)) {
svalue = unquote(svalue);
--
1.7.5.4
More information about the Xorp-hackers
mailing list