On Tue, Sep 03, 2019 at 11:33:13PM +0200, Fernando Fernandez Mancera wrote:
> Fixes: d62d0ba97b58 ("netfilter: nf_tables: Introduce stateful object update 
> operation")
> Signed-off-by: Fernando Fernandez Mancera <[email protected]>
> ---
>  net/netfilter/nf_tables_api.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
> index cf767bc58e18..6893de9e1389 100644
> --- a/net/netfilter/nf_tables_api.c
> +++ b/net/netfilter/nf_tables_api.c
> @@ -6477,7 +6477,8 @@ static void nft_obj_commit_update(struct nft_trans 
> *trans)
>       obj = nft_trans_obj(trans);
>       newobj = nft_trans_obj_newobj(trans);
>  
> -     obj->ops->update(obj, newobj);
> +     if (obj->ops->update)
> +             obj->ops->update(obj, newobj);

Please, check for obj->ops->update() from the preparation phase, ie.
from nf_tables_updobj().

If obj->ops->update is NULL, then return -EOPNOTSUPP.

Reply via email to