[nft PATCH] evaluate: Return ENOENT if rule index is too large

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

 



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@xxxxxx>
---
 src/evaluate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/evaluate.c b/src/evaluate.c
index cb27f7c269049..4eb36e2d38792 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;
 }
 
-- 
2.17.0

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