]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
nft: generalize rule addition family hook
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 8 Sep 2013 21:53:05 +0000 (23:53 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 30 Dec 2013 22:50:45 +0000 (23:50 +0100)
This should help Giuseppe with his ARP support works, this change
was missing in (618309c nft: refactoring parse operations for more
genericity).

Based on patch from Giuseppe.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/nft-ipv4.c
iptables/nft-ipv6.c
iptables/nft-shared.h

index b7a60952f8625b52e4cd8240132de9fafe03d11c..40340984edc98e48fb9d3135ca9e7e42cb24a7b4 100644 (file)
@@ -24,8 +24,9 @@
 
 #include "nft-shared.h"
 
-static int nft_ipv4_add(struct nft_rule *r, struct iptables_command_state *cs)
+static int nft_ipv4_add(struct nft_rule *r, void *data)
 {
+       struct iptables_command_state *cs = data;
        uint32_t op;
 
        if (cs->fw.ip.iniface[0] != '\0')
index 27e63a45c9e2c4ac1679d20a3f88a923464207a6..2efe95e3a890090b5c79062e7244180d4701cf13 100644 (file)
 
 #include "nft-shared.h"
 
-static int nft_ipv6_add(struct nft_rule *r, struct iptables_command_state *cs)
+static int nft_ipv6_add(struct nft_rule *r, void *data)
 {
+       struct iptables_command_state *cs = data;
+
        if (cs->fw6.ipv6.iniface[0] != '\0')
                add_iniface(r, cs->fw6.ipv6.iniface, cs->fw6.ipv6.invflags);
 
index ed2617cb21790aabbad9544a60b8cb9df7e528eb..3f1a9a4a87cd3631716f4a9906311e4eb0610854 100644 (file)
@@ -37,7 +37,7 @@
 struct xtables_args;
 
 struct nft_family_ops {
-       int (*add)(struct nft_rule *r, struct iptables_command_state *cs);
+       int (*add)(struct nft_rule *r, void *data);
        bool (*is_same)(const struct iptables_command_state *a,
                        const struct iptables_command_state *b);
        void (*print_payload)(struct nft_rule_expr *e,