diff options
| author | Vlad Buslov <vladbu@nvidia.com> | 2022-06-15 12:43:54 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-07-05 09:12:39 +0200 |
| commit | b4899d75b8432d499ed9d1c3d0013f98e8f4f3c9 (patch) | |
| tree | 489a475d72fe1d6999dcff0da51a49c8ee348427 /net | |
| parent | 3eb1b39627892c4e26cb0162b75725aa5fcc60c8 (diff) | |
| download | linux-b4899d75b8432d499ed9d1c3d0013f98e8f4f3c9.tar.gz linux-b4899d75b8432d499ed9d1c3d0013f98e8f4f3c9.tar.bz2 linux-b4899d75b8432d499ed9d1c3d0013f98e8f4f3c9.zip | |
net/sched: act_ct: set 'net' pointer when creating new nf_flow_table
[ Upstream commit fc54d9065f90dd25063883f404e6ff9a76913e73 ]
Following patches in series use the pointer to access flow table offload
debug variables.
Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Oz Shlomo <ozsh@nvidia.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Stable-dep-of: 88c67aeb1407 ("sched: act_ct: add netns into the key of tcf_ct_flow_table")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
| -rw-r--r-- | net/sched/act_ct.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index 2d41d866de3e..155426d5a48f 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -275,7 +275,7 @@ static struct nf_flowtable_type flowtable_ct = { .owner = THIS_MODULE, }; -static int tcf_ct_flow_table_get(struct tcf_ct_params *params) +static int tcf_ct_flow_table_get(struct net *net, struct tcf_ct_params *params) { struct tcf_ct_flow_table *ct_ft; int err = -ENOMEM; @@ -300,6 +300,7 @@ static int tcf_ct_flow_table_get(struct tcf_ct_params *params) err = nf_flow_table_init(&ct_ft->nf_ft); if (err) goto err_init; + write_pnet(&ct_ft->nf_ft.net, net); __module_get(THIS_MODULE); out_unlock: @@ -1291,7 +1292,7 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla, if (err) goto cleanup; - err = tcf_ct_flow_table_get(params); + err = tcf_ct_flow_table_get(net, params); if (err) goto cleanup_params; |
