[PATCH nft 4/4] evaluate: use recursive call for SET_REF handling

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

 



We can now call the helper again, with set->init as new RHS expression.

Signed-off-by: Florian Westphal <fw@xxxxxxxxx>
---
 src/evaluate.c | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/src/evaluate.c b/src/evaluate.c
index 9641623bee1f..b7796d1c3f54 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -1552,35 +1552,7 @@ static int __binop_transfer(struct eval_ctx *ctx, struct expr **expr,
 		}
 		break;
 	case EXPR_SET_REF:
-		list_for_each_entry(i, &(*right)->set->init->expressions, list) {
-			switch (i->key->ops->type) {
-			case EXPR_VALUE:
-			case EXPR_RANGE:
-			case EXPR_SET_ELEM:
-				err = binop_can_transfer(ctx, left, i->key);
-				if (err <= 0)
-					return err;
-				break;
-			default:
-				break;
-			}
-		}
-		list_for_each_entry_safe(i, next, &(*right)->set->init->expressions,
-					 list) {
-			list_del(&i->list);
-			switch (i->key->ops->type) {
-			case EXPR_VALUE:
-			case EXPR_RANGE:
-			case EXPR_SET_ELEM:
-				if (binop_transfer_one(ctx, left, &i->key) < 0)
-					return -1;
-				break;
-			default:
-				break;
-			}
-			list_add_tail(&i->list, &next->list);
-		}
-		break;
+		return __binop_transfer(ctx, expr, left, &(*right)->set->init);
 	default:
 		return 0;
 	}
-- 
2.16.1

--
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