]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
src: get rid of netlink_genid_get()
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 28 Sep 2018 12:55:56 +0000 (14:55 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 4 Oct 2018 00:13:58 +0000 (02:13 +0200)
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/netlink.h
src/netlink.c
src/rule.c

index d153e2be03ac5d0fa2c19f845261491ae597cc5d..4925af04a707c9d0bd92a5d0a15fd33fff74598e 100644 (file)
@@ -195,7 +195,6 @@ extern void netlink_dump_obj(struct nftnl_obj *nlo, struct netlink_ctx *ctx);
 
 extern int netlink_batch_send(struct netlink_ctx *ctx, struct list_head *err_list);
 
-extern uint16_t netlink_genid_get(struct netlink_ctx *ctx);
 extern void netlink_restart(struct mnl_socket *nf_sock);
 #define netlink_abi_error()    \
        __netlink_abi_error(__FILE__, __LINE__, strerror(errno));
index 7639847b56c92c7e15c76a298ad2914718eabf46..f40678f8c01b246597c036f5743995eb3c68edd3 100644 (file)
@@ -79,11 +79,6 @@ void netlink_restart(struct mnl_socket *nf_sock)
        nf_sock = netlink_open_sock();
 }
 
-uint16_t netlink_genid_get(struct netlink_ctx *ctx)
-{
-       return mnl_genid_get(ctx);
-}
-
 void __noreturn __netlink_abi_error(const char *file, int line,
                                    const char *reason)
 {
index 6d027c261f9715289c602a72b79a49c8218e5d75..32b13b19b6e14104a4d64decd4347cf25b9c09b4 100644 (file)
@@ -235,7 +235,7 @@ int cache_update(struct mnl_socket *nf_sock, struct nft_cache *cache,
 
 replay:
        ctx.seqnum = cache->seqnum++;
-       genid = netlink_genid_get(&ctx);
+       genid = mnl_genid_get(&ctx);
        if (genid && genid == cache->genid)
                return 0;
        if (cache->genid)
@@ -278,7 +278,7 @@ void cache_flush(struct mnl_socket *nf_sock, struct nft_cache *cache,
        };
 
        __cache_flush(&cache->list);
-       cache->genid = netlink_genid_get(&ctx);
+       cache->genid = mnl_genid_get(&ctx);
 }
 
 void cache_release(struct nft_cache *cache)
@@ -1341,6 +1341,7 @@ void cmd_free(struct cmd *cmd)
 }
 
 #include <netlink.h>
+#include <mnl.h>
 
 static int __do_add_setelems(struct netlink_ctx *ctx, const struct handle *h,
                             struct set *set, struct expr *expr, uint32_t flags)