From 8951c655e95b790ead4ff73a98b6c8027df876de Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 7 Jun 2019 11:06:56 +0200 Subject: src: generation ID is 32-bit long Update mnl_genid_get() to return 32-bit long generation ID. Add nft_genid_u16() which allows us to catch ruleset updates from the netlink dump path via 16-bit long nfnetlink resource ID field. Signed-off-by: Pablo Neira Ayuso --- src/rule.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/rule.c') diff --git a/src/rule.c b/src/rule.c index 1e081c8f..65145473 100644 --- a/src/rule.c +++ b/src/rule.c @@ -244,8 +244,6 @@ static bool cache_is_updated(struct nft_cache *cache, uint16_t genid) int cache_update(struct nft_ctx *nft, enum cmd_ops cmd, struct list_head *msgs) { - uint16_t genid; - int ret; struct netlink_ctx ctx = { .list = LIST_HEAD_INIT(ctx.list), .nft = nft, @@ -253,7 +251,8 @@ int cache_update(struct nft_ctx *nft, enum cmd_ops cmd, struct list_head *msgs) .nft = nft, }; struct nft_cache *cache = &nft->cache; - + uint32_t genid; + int ret; replay: ctx.seqnum = cache->seqnum++; genid = mnl_genid_get(&ctx); -- cgit v1.2.3