diff options
author | Michael Larson <slioch@slioch.vyatta.com> | 2010-05-26 13:49:12 -0700 |
---|---|---|
committer | Michael Larson <slioch@slioch.vyatta.com> | 2010-05-26 13:49:12 -0700 |
commit | b5366b375228c1e7041ba52e469f099f0d0f1a61 (patch) | |
tree | 5bc88a0256619ea1e934e4b0b78d042bdd97842b /src/cli_new.c | |
parent | feb1fbcefdedffcec672834a04d6279b229624c3 (diff) | |
download | vyatta-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.c | 10 |
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: |