]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
netlink: use libnl OBJ_CAST macro
authorPatrick McHardy <kaber@trash.net>
Tue, 31 Mar 2009 02:14:21 +0000 (04:14 +0200)
committerPatrick McHardy <kaber@trash.net>
Tue, 31 Mar 2009 02:14:21 +0000 (04:14 +0200)
Signed-off-by: Patrick McHardy <kaber@trash.net>
src/netlink.c
src/netlink_linearize.c

index 7ba901142fb47fc31f4228da93fa258984161c6c..548f4fb877d02616f2e7c5087de15a541ebfe3a6 100644 (file)
@@ -199,8 +199,7 @@ static int netlink_list_rules(struct netlink_ctx *ctx, const struct handle *h)
                                        nl_geterror(err));
 
        nlr = alloc_nft_rule(h);
-       nl_cache_foreach_filter(rule_cache, (struct nl_object *)nlr,
-                               list_rule_cb, ctx);
+       nl_cache_foreach_filter(rule_cache, OBJ_CAST(nlr), list_rule_cb, ctx);
        nfnl_nft_rule_put(nlr);
        nl_cache_free(rule_cache);
        return 0;
@@ -254,8 +253,7 @@ static int netlink_flush_rules(struct netlink_ctx *ctx, const struct handle *h)
                                        nl_geterror(err));
 
        nlr = alloc_nft_rule(h);
-       nl_cache_foreach_filter(rule_cache, (struct nl_object *)nlr,
-                               flush_rule_cb, ctx);
+       nl_cache_foreach_filter(rule_cache, OBJ_CAST(nlr), flush_rule_cb, ctx);
        nfnl_nft_rule_put(nlr);
        nl_cache_free(rule_cache);
        return 0;
@@ -332,8 +330,7 @@ int netlink_list_chains(struct netlink_ctx *ctx, const struct handle *h)
                                        nl_geterror(err));
 
        nlc = alloc_nft_chain(h);
-       nl_cache_foreach_filter(chain_cache, (struct nl_object *)nlc,
-                               list_chain_cb, ctx);
+       nl_cache_foreach_filter(chain_cache, OBJ_CAST(nlc), list_chain_cb, ctx);
        nfnl_nft_chain_put(nlc);
        nl_cache_free(chain_cache);
        return 0;
@@ -436,8 +433,7 @@ int netlink_list_tables(struct netlink_ctx *ctx, const struct handle *h)
                                        nl_geterror(err));
 
        nlt = alloc_nft_table(h);
-       nl_cache_foreach_filter(table_cache, (struct nl_object *)nlt,
-                               list_table_cb, ctx);
+       nl_cache_foreach_filter(table_cache, OBJ_CAST(nlt), list_table_cb, ctx);
        nfnl_nft_table_put(nlt);
        nl_cache_free(table_cache);
        return 0;
index 0a28b29791d731408a3600d1306a35514bdd4d96..0b3f8194f2e4f6d294a1e7133c0ae5ff61a2c9d0 100644 (file)
@@ -714,7 +714,7 @@ int netlink_linearize_rule(struct netlink_ctx *ctx, struct nfnl_nft_rule *nlr,
                netlink_gen_stmt(&lctx, stmt);
 
 #ifdef DEBUG
-       netlink_dump_object((struct nl_object *)nlr);
+       netlink_dump_object(OBJ_CAST(nlr));
 #endif
        return 0;
 }