summaryrefslogtreecommitdiff
path: root/src/cli_new.c
diff options
context:
space:
mode:
authorMichael Larson <slioch@slioch.vyatta.com>2010-05-26 13:49:12 -0700
committerMichael Larson <slioch@slioch.vyatta.com>2010-05-26 13:49:12 -0700
commitb5366b375228c1e7041ba52e469f099f0d0f1a61 (patch)
tree5bc88a0256619ea1e934e4b0b78d042bdd97842b /src/cli_new.c
parentfeb1fbcefdedffcec672834a04d6279b229624c3 (diff)
downloadvyatta-cfg-b5366b375228c1e7041ba52e469f099f0d0f1a61.tar.gz
vyatta-cfg-b5366b375228c1e7041ba52e469f099f0d0f1a61.zip
fix for multiple type support in cli for the following case:
1) If multiple types are defined and one type is a submatch of the other type (i.e. ipv4 and ipv4net) 2) And one string is a submatch of the other (i.e. 3.3.3.3 and 3.3.3.3/32) 3) Then compare data types before comparing for value equality Fixes problem where the ipv4net wouldn't let the ipv4 value from being set if the ipv4 was a substring of the ipv4net.
Diffstat (limited to 'src/cli_new.c')
-rw-r--r--src/cli_new.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cli_new.c b/src/cli_new.c
index c4d1b86..b2d6e1d 100644
--- a/src/cli_new.c
+++ b/src/cli_new.c
@@ -926,7 +926,15 @@ boolean val_cmp(const valstruct *left, const valstruct *right, vtw_cond_e cond)
rval = right->val;
else
rval = right->vals[rcur];
-
+
+ //don't bother comparing if these are different types.
+ if ((rcur || right->cnt)
+ && right->val_types[rcur] != NULL) {
+ if (right->val_types[rcur] != val_type) {
+ continue;
+ }
+ }
+
parts_num = 0;
switch (val_type) {
case IPV6_TYPE: