summaryrefslogtreecommitdiff
path: root/ovn
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2016-10-06 18:08:30 -0700
committerBen Pfaff <blp@ovn.org>2016-10-11 08:35:17 -0700
commita3d7906886883f16db80539df211c630628ed50f (patch)
tree66b7cfe01bd1d6802679474df3ec8da86b8a3840 /ovn
parent97ba1d55139d8348a7574b7947b21251befb2d4c (diff)
downloadopenvswitch-a3d7906886883f16db80539df211c630628ed50f.tar.gz
expr: Fix abort when simplifying "x != 0/0".
The test added by this commit is very specific to the particular problem, whereas a more general test would be better. A later commit adds the general test. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
Diffstat (limited to 'ovn')
-rw-r--r--ovn/lib/expr.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ovn/lib/expr.c b/ovn/lib/expr.c
index a5dbcfaa4..a197474e3 100644
--- a/ovn/lib/expr.c
+++ b/ovn/lib/expr.c
@@ -1702,7 +1702,16 @@ expr_simplify_ne(struct expr *expr)
new = expr_combine(EXPR_T_OR, new, e);
}
- ovs_assert(new);
+ if (!new) {
+ /* Handle a comparison like "ip4.dst != 0/0", where the mask has no
+ * 1-bits.
+ *
+ * The correct result for this expression may not be obvious. It's
+ * easier to understand that "ip4.dst == 0/0" should be true, since 0/0
+ * matches every IPv4 address; then, "ip4.dst != 0/0" should have the
+ * opposite result. */
+ new = expr_create_boolean(false);
+ }
expr_destroy(expr);