From 816d8c7659c1d90ce6827baaa939820a3bae2ae0 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 9 May 2018 16:03:42 +0200 Subject: Support 'add/insert rule index ' Allow to specify an absolute rule position in add/insert commands like with iptables. The translation to rule handle takes place in userspace, so no kernel support for this is needed. Possible undesired effects are pointed out in man page to make users aware that this way of specifying a rule location might not be ideal. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/rule.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/rule.c') diff --git a/src/rule.c b/src/rule.c index a365876d..279b741b 100644 --- a/src/rule.c +++ b/src/rule.c @@ -60,6 +60,8 @@ void handle_merge(struct handle *dst, const struct handle *src) dst->handle = src->handle; if (dst->position.id == 0) dst->position = src->position; + if (dst->index.id == 0) + dst->index = src->index; } static int cache_init_tables(struct netlink_ctx *ctx, struct handle *h, -- cgit v1.2.3