Re: [PATCH net-next 1/8] net/sched: act_ct: set 'net' pointer when creating new nf_flow_table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 22, 2022 at 05:09:56PM +0200, Vlad Buslov wrote:
> Following patches in series use the pointer to access flow table offload
> debug variables.
> 
> Signed-off-by: Vlad Buslov <vladbu@xxxxxxxxxx>
> Signed-off-by: Oz Shlomo <ozsh@xxxxxxxxxx>
> Reviewed-by: Paul Blakey <paulb@xxxxxxxxxx>

Acked-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>

> ---
>  net/sched/act_ct.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c
> index 7108e71ce4db..a2624f6c4d92 100644
> --- a/net/sched/act_ct.c
> +++ b/net/sched/act_ct.c
> @@ -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;
> @@ -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:
> @@ -1321,7 +1322,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;
>  
> -- 
> 2.31.1
> 



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux