From 50323910f2214de6fa333c3bf0c1452842b5a924 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Sun, 7 May 2017 02:40:46 +0200 Subject: src: add a comment wrt. reject dependency insertion at first I thought this was a bug but this in fact seems the right thing, add a comment/example why adding dependency as first statement makes sense. Signed-off-by: Florian Westphal --- src/evaluate.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/evaluate.c b/src/evaluate.c index 1cfe7675..27cee989 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -2015,6 +2015,14 @@ static int stmt_reject_gen_dependency(struct eval_ctx *ctx, struct stmt *stmt, if (payload_gen_dependency(ctx, payload, &nstmt) < 0) return -1; + /* + * Unlike payload deps this adds the dependency at the beginning, i.e. + * log ... reject with tcp-reset + * turns into + * meta l4proto tcp log ... reject with tcp-reset + * + * Otherwise we'd log things that won't be rejected. + */ list_add(&nstmt->list, &ctx->rule->stmts); return 0; } -- cgit v1.2.3