|
@@ -208,37 +208,37 @@ static const struct nla_policy nft_ct_policy[NFTA_CT_MAX + 1] = {
|
|
[NFTA_CT_SREG] = { .type = NLA_U32 },
|
|
[NFTA_CT_SREG] = { .type = NLA_U32 },
|
|
};
|
|
};
|
|
|
|
|
|
-static int nft_ct_l3proto_try_module_get(uint8_t family)
|
|
|
|
|
|
+static int nft_ct_netns_get(struct net *net, uint8_t family)
|
|
{
|
|
{
|
|
int err;
|
|
int err;
|
|
|
|
|
|
if (family == NFPROTO_INET) {
|
|
if (family == NFPROTO_INET) {
|
|
- err = nf_ct_l3proto_try_module_get(NFPROTO_IPV4);
|
|
|
|
|
|
+ err = nf_ct_netns_get(net, NFPROTO_IPV4);
|
|
if (err < 0)
|
|
if (err < 0)
|
|
goto err1;
|
|
goto err1;
|
|
- err = nf_ct_l3proto_try_module_get(NFPROTO_IPV6);
|
|
|
|
|
|
+ err = nf_ct_netns_get(net, NFPROTO_IPV6);
|
|
if (err < 0)
|
|
if (err < 0)
|
|
goto err2;
|
|
goto err2;
|
|
} else {
|
|
} else {
|
|
- err = nf_ct_l3proto_try_module_get(family);
|
|
|
|
|
|
+ err = nf_ct_netns_get(net, family);
|
|
if (err < 0)
|
|
if (err < 0)
|
|
goto err1;
|
|
goto err1;
|
|
}
|
|
}
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
err2:
|
|
err2:
|
|
- nf_ct_l3proto_module_put(NFPROTO_IPV4);
|
|
|
|
|
|
+ nf_ct_netns_put(net, NFPROTO_IPV4);
|
|
err1:
|
|
err1:
|
|
return err;
|
|
return err;
|
|
}
|
|
}
|
|
|
|
|
|
-static void nft_ct_l3proto_module_put(uint8_t family)
|
|
|
|
|
|
+static void nft_ct_netns_put(struct net *net, uint8_t family)
|
|
{
|
|
{
|
|
if (family == NFPROTO_INET) {
|
|
if (family == NFPROTO_INET) {
|
|
- nf_ct_l3proto_module_put(NFPROTO_IPV4);
|
|
|
|
- nf_ct_l3proto_module_put(NFPROTO_IPV6);
|
|
|
|
|
|
+ nf_ct_netns_put(net, NFPROTO_IPV4);
|
|
|
|
+ nf_ct_netns_put(net, NFPROTO_IPV6);
|
|
} else
|
|
} else
|
|
- nf_ct_l3proto_module_put(family);
|
|
|
|
|
|
+ nf_ct_netns_put(net, family);
|
|
}
|
|
}
|
|
|
|
|
|
static int nft_ct_get_init(const struct nft_ctx *ctx,
|
|
static int nft_ct_get_init(const struct nft_ctx *ctx,
|
|
@@ -342,7 +342,7 @@ static int nft_ct_get_init(const struct nft_ctx *ctx,
|
|
if (err < 0)
|
|
if (err < 0)
|
|
return err;
|
|
return err;
|
|
|
|
|
|
- err = nft_ct_l3proto_try_module_get(ctx->afi->family);
|
|
|
|
|
|
+ err = nft_ct_netns_get(ctx->net, ctx->afi->family);
|
|
if (err < 0)
|
|
if (err < 0)
|
|
return err;
|
|
return err;
|
|
|
|
|
|
@@ -390,7 +390,7 @@ static int nft_ct_set_init(const struct nft_ctx *ctx,
|
|
if (err < 0)
|
|
if (err < 0)
|
|
goto err1;
|
|
goto err1;
|
|
|
|
|
|
- err = nft_ct_l3proto_try_module_get(ctx->afi->family);
|
|
|
|
|
|
+ err = nft_ct_netns_get(ctx->net, ctx->afi->family);
|
|
if (err < 0)
|
|
if (err < 0)
|
|
goto err1;
|
|
goto err1;
|
|
|
|
|
|
@@ -405,7 +405,7 @@ err1:
|
|
static void nft_ct_get_destroy(const struct nft_ctx *ctx,
|
|
static void nft_ct_get_destroy(const struct nft_ctx *ctx,
|
|
const struct nft_expr *expr)
|
|
const struct nft_expr *expr)
|
|
{
|
|
{
|
|
- nft_ct_l3proto_module_put(ctx->afi->family);
|
|
|
|
|
|
+ nf_ct_netns_put(ctx->net, ctx->afi->family);
|
|
}
|
|
}
|
|
|
|
|
|
static void nft_ct_set_destroy(const struct nft_ctx *ctx,
|
|
static void nft_ct_set_destroy(const struct nft_ctx *ctx,
|
|
@@ -423,7 +423,7 @@ static void nft_ct_set_destroy(const struct nft_ctx *ctx,
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- nft_ct_l3proto_module_put(ctx->afi->family);
|
|
|
|
|
|
+ nft_ct_netns_put(ctx->net, ctx->afi->family);
|
|
}
|
|
}
|
|
|
|
|
|
static int nft_ct_get_dump(struct sk_buff *skb, const struct nft_expr *expr)
|
|
static int nft_ct_get_dump(struct sk_buff *skb, const struct nft_expr *expr)
|