summaryrefslogtreecommitdiff
path: root/ovsdb
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2018-09-06 19:30:11 -0700
committerBen Pfaff <blp@ovn.org>2018-10-03 18:13:45 -0700
commit64107d596747179436cb7a4bd6ab31ba277d136b (patch)
tree5cef317b691facfffa8d585e4415bafa964e3db8 /ovsdb
parentfcaba95e26d695f59379cd1b930d8243d5b551c0 (diff)
downloadopenvswitch-64107d596747179436cb7a4bd6ab31ba277d136b.tar.gz
condition: Reject <, <=, >=, > with optional scalar against empty set.
When relational comparisons against optional scalars were introduced, it was meant to work only when the right-hand side of the comparison was a scalar, not the empty set. The implementation wasn't that picky. This commit fixes the problem. CC: Terry Wilson <twilson@redhat.com> Fixes: 09e256031a62 ("ovsdb: Allow comparison on optional scalar types") Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
Diffstat (limited to 'ovsdb')
-rw-r--r--ovsdb/condition.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ovsdb/condition.c b/ovsdb/condition.c
index 06126d292..692c09328 100644
--- a/ovsdb/condition.c
+++ b/ovsdb/condition.c
@@ -125,7 +125,12 @@ ovsdb_clause_from_json(const struct ovsdb_table_schema *ts,
free(s);
return error;
}
+
+ /* Force the argument to be a scalar. */
+ type.n_min = 1;
+
break;
+
case OVSDB_F_EQ:
case OVSDB_F_NE:
break;