[PATCH nft 3/3] Revert "evaluate: check for NULL datatype in rhs in lookup expr"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This reverts commit 5afa5a164ff1c066af1ec56d875b91562882bd50.
This commit is obsoleted by removing the possibility for a NULL right->dtype in
the first place, at set declaration.

Signed-off-by: Anatole Denis <anatole@xxxxxxxxx>
---
 src/evaluate.c | 31 ++++++++-----------------------
 1 file changed, 8 insertions(+), 23 deletions(-)

diff --git a/src/evaluate.c b/src/evaluate.c
index b12af14..51d644f 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -1467,33 +1467,18 @@ static int expr_evaluate_relational(struct eval_ctx *ctx, struct expr **expr)
 
 	switch (rel->op) {
 	case OP_LOOKUP:
-		switch (right->ops->type) {
-		case EXPR_SET:
-			/* A literal set expression implicitly declares
-			 * the set
-			 */
+		/* A literal set expression implicitly declares the set */
+		if (right->ops->type == EXPR_SET)
 			right = rel->right =
 				implicit_set_declaration(ctx, "__set%d",
 							 left->dtype,
 							 left->len, right);
-			break;
-		case EXPR_SET_REF:
-			if (right->dtype == NULL)
-				return expr_binary_error(ctx->msgs, right,
-							 left, "the referenced"
-							 " set does not "
-							 "exist");
-			if (!datatype_equal(left->dtype, right->dtype))
-				return expr_binary_error(ctx->msgs, right,
-							 left, "datatype "
-							 "mismatch, expected "
-							 "%s, set has type %s",
-							 left->dtype->desc,
-							 right->dtype->desc);
-			break;
-		default:
-			BUG("Unknown expression %s\n", right->ops->name);
-		}
+		else if (!datatype_equal(left->dtype, right->dtype))
+			return expr_binary_error(ctx->msgs, right, left,
+						 "datatype mismatch, expected %s, "
+						 "set has type %s",
+						 left->dtype->desc,
+						 right->dtype->desc);
 
 		/* Data for range lookups needs to be in big endian order */
 		if (right->set->flags & SET_F_INTERVAL &&
-- 
2.11.0.rc2

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux