Skip to content

Commit

Permalink
net/sched: act_ct: set 'net' pointer when creating new nf_flow_table
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vlad Buslov authored and Pablo Neira Ayuso committed Jul 11, 2022
1 parent b8acd43 commit fc54d90
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/sched/act_ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,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;
Expand All @@ -303,6 +303,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:
Expand Down Expand Up @@ -1391,7 +1392,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;

Expand Down

0 comments on commit fc54d90

Please sign in to comment.