summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-05-11 12:33:46 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-05-11 13:21:28 +0200
commitac79bea034766adc19067c3307f2ad6bdae4c36f (patch)
treef47c877823b29c22436d24e9cdb201d7f0fd2586 /src
parentd196dccf1853039656f15c8da94ad349a3b7d07c (diff)
evaluate: Return ENOENT if rule index is too large
Since EINVAL usually indicates errors from kernel, avoid using it here too. Instead return ENOENT to indicate there's no entry to append or prepend the rule to. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/evaluate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index cb27f7c2..4eb36e2d 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -2888,7 +2888,7 @@ static int rule_translate_index(struct eval_ctx *ctx, struct rule *rule)
if (!rule->handle.position.id)
return cmd_error(ctx, &rule->handle.index.location,
"Could not process rule: %s",
- strerror(EINVAL));
+ strerror(ENOENT));
return 0;
}