{
const struct proto_hdr_template *tmpl;
struct expr *dep, *left, *right;
+ unsigned int stmt_len;
struct stmt *stmt;
- int protocol = proto_find_num(desc, upper);
+ int protocol;
+ protocol = proto_find_num(desc, upper);
if (protocol < 0)
return expr_error(ctx->msgs, expr,
"conflicting protocols specified: %s vs. %s",
constant_data_ptr(protocol, tmpl->len));
dep = relational_expr_alloc(&expr->location, OP_EQ, left, right);
+
+ stmt_len = ctx->stmt_len;
+ ctx->stmt_len = 0;
+
stmt = expr_stmt_alloc(&dep->location, dep);
if (stmt_evaluate(ctx, stmt) < 0) {
return expr_error(ctx->msgs, expr,
"dependency statement is invalid");
}
+ ctx->stmt_len = stmt_len;
+
relational_expr_pctx_update(&ctx->pctx, dep);
*res = stmt;
return 0;
{
const struct hook_proto_desc *h = &hook_proto_desc[ctx->pctx.family];
const struct proto_desc *desc;
+ unsigned int stmt_len;
struct stmt *stmt;
uint16_t type;
"protocol specification is invalid "
"for this family");
+ stmt_len = ctx->stmt_len;
+ ctx->stmt_len = 0;
+
stmt = meta_stmt_meta_iiftype(&expr->location, type);
if (stmt_evaluate(ctx, stmt) < 0) {
return expr_error(ctx->msgs, expr,
"dependency statement is invalid");
}
*res = stmt;
+
+ ctx->stmt_len = stmt_len;
+
return 0;
}