netfilter: nf_tables: add missing module references to chain types
authorPatrick McHardy <kaber@trash.net>
Thu, 9 Jan 2014 18:42:35 +0000 (18:42 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 9 Jan 2014 19:17:14 +0000 (20:17 +0100)
In some cases we neither take a reference to the AF info nor to the
chain type, allowing the module to be unloaded while in use.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/bridge/netfilter/nf_tables_bridge.c
net/ipv4/netfilter/nf_tables_arp.c
net/ipv4/netfilter/nf_tables_ipv4.c
net/ipv6/netfilter/nf_tables_ipv6.c
net/netfilter/nf_tables_inet.c

index 003c1e9a8b0c29629740c6b6d0724d1850e202ed..f97222eb8235425338d205ad2d84e2cebcbcfdae 100644 (file)
@@ -72,6 +72,7 @@ static struct nf_chain_type filter_bridge = {
        .family         = NFPROTO_BRIDGE,
        .name           = "filter",
        .type           = NFT_CHAIN_T_DEFAULT,
+       .me             = THIS_MODULE,
        .hook_mask      = (1 << NF_BR_LOCAL_IN) |
                          (1 << NF_BR_FORWARD) |
                          (1 << NF_BR_LOCAL_OUT),
index 36d27fc7e859eaeedd4f521f11cbfac43b6e42ec..228df003f3cc5f7c2e5ef1c1a8c80aa5a409afb9 100644 (file)
@@ -72,6 +72,7 @@ static struct nf_chain_type filter_arp = {
        .family         = NFPROTO_ARP,
        .name           = "filter",
        .type           = NFT_CHAIN_T_DEFAULT,
+       .me             = THIS_MODULE,
        .hook_mask      = (1 << NF_ARP_IN) |
                          (1 << NF_ARP_OUT) |
                          (1 << NF_ARP_FORWARD),
index da927dc9f6363ef2ad31f35fef490f7097530287..d6fc1b4ace4ebcd957912d1a74cabf8452bff48b 100644 (file)
@@ -95,6 +95,7 @@ static struct nf_chain_type filter_ipv4 = {
        .family         = NFPROTO_IPV4,
        .name           = "filter",
        .type           = NFT_CHAIN_T_DEFAULT,
+       .me             = THIS_MODULE,
        .hook_mask      = (1 << NF_INET_LOCAL_IN) |
                          (1 << NF_INET_LOCAL_OUT) |
                          (1 << NF_INET_FORWARD) |
index 025e7f4e8ac57886101f3a156acffdd2b05d2e95..a34027687ecd647e06abad220ac0947fbc9ebb42 100644 (file)
@@ -94,6 +94,7 @@ static struct nf_chain_type filter_ipv6 = {
        .family         = NFPROTO_IPV6,
        .name           = "filter",
        .type           = NFT_CHAIN_T_DEFAULT,
+       .me             = THIS_MODULE,
        .hook_mask      = (1 << NF_INET_LOCAL_IN) |
                          (1 << NF_INET_LOCAL_OUT) |
                          (1 << NF_INET_FORWARD) |
index ac0edcb549de34d93a580e5a843623459f7a67e8..280d3a2d5abc804d67ff37f07a5e10dcb56d9e27 100644 (file)
@@ -70,6 +70,7 @@ static struct nf_chain_type filter_inet = {
        .family         = NFPROTO_INET,
        .name           = "filter",
        .type           = NFT_CHAIN_T_DEFAULT,
+       .me             = THIS_MODULE,
        .hook_mask      = (1 << NF_INET_LOCAL_IN) |
                          (1 << NF_INET_LOCAL_OUT) |
                          (1 << NF_INET_FORWARD) |