From: Phil Sutter Date: Fri, 11 May 2018 10:33:46 +0000 (+0200) Subject: evaluate: Return ENOENT if rule index is too large X-Git-Tag: v0.9.0~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac79bea034766adc19067c3307f2ad6bdae4c36f;p=thirdparty%2Fnftables.git 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 Signed-off-by: Pablo Neira Ayuso --- 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; }