]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
mnl: use nft_*_list_add_tail
authorPablo Neira Ayuso <pablo@soleta.eu>
Tue, 16 Jul 2013 20:35:07 +0000 (22:35 +0200)
committerPablo Neira Ayuso <pablo@soleta.eu>
Tue, 16 Jul 2013 20:35:07 +0000 (22:35 +0200)
Adapt it to the semantic fix that has been applied to libnftables,
nft_*_list_add now inserts nodes, instead of appending them.

Signed-off-by: Pablo Neira Ayuso <pablo@soleta.eu>
src/mnl.c

index ea9637c83ae51ccc816bbbd4525aec47c580d3de..a58f7ea89de0c86c6145492d89179c3eaae13477 100644 (file)
--- a/src/mnl.c
+++ b/src/mnl.c
@@ -93,7 +93,7 @@ static int rule_cb(const struct nlmsghdr *nlh, void *data)
        if (nft_rule_nlmsg_parse(nlh, r) < 0)
                goto err_free;
 
-       nft_rule_list_add(r, nlr_list);
+       nft_rule_list_add_tail(r, nlr_list);
        return MNL_CB_OK;
 
 err_free:
@@ -169,7 +169,7 @@ static int chain_cb(const struct nlmsghdr *nlh, void *data)
        if (nft_chain_nlmsg_parse(nlh, c) < 0)
                goto err_free;
 
-       nft_chain_list_add(c, nlc_list);
+       nft_chain_list_add_tail(c, nlc_list);
        return MNL_CB_OK;
 
 err_free:
@@ -264,7 +264,7 @@ static int table_cb(const struct nlmsghdr *nlh, void *data)
        if (nft_table_nlmsg_parse(nlh, t) < 0)
                goto err_free;
 
-       nft_table_list_add(t, nlt_list);
+       nft_table_list_add_tail(t, nlt_list);
        return MNL_CB_OK;
 
 err_free:
@@ -365,7 +365,7 @@ static int set_cb(const struct nlmsghdr *nlh, void *data)
        if (nft_set_nlmsg_parse(nlh, s) < 0)
                goto err_free;
 
-       nft_set_list_add(s, nls_list);
+       nft_set_list_add_tail(s, nls_list);
        return MNL_CB_OK;
 
 err_free: