File tree Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -422,14 +422,14 @@ int nft_flow_rule_offload_commit(struct net *net)
422422 continue ;
423423
424424 if (trans -> ctx .flags & NLM_F_REPLACE ||
425- !(trans -> ctx .flags & NLM_F_APPEND ))
426- return - EOPNOTSUPP ;
427-
425+ !(trans -> ctx .flags & NLM_F_APPEND )) {
426+ err = - EOPNOTSUPP ;
427+ break ;
428+ }
428429 err = nft_flow_offload_rule (trans -> ctx .chain ,
429430 nft_trans_rule (trans ),
430431 nft_trans_flow_rule (trans ),
431432 FLOW_CLS_REPLACE );
432- nft_flow_rule_destroy (nft_trans_flow_rule (trans ));
433433 break ;
434434 case NFT_MSG_DELRULE :
435435 if (!(trans -> ctx .chain -> flags & NFT_CHAIN_HW_OFFLOAD ))
@@ -442,7 +442,23 @@ int nft_flow_rule_offload_commit(struct net *net)
442442 }
443443
444444 if (err )
445- return err ;
445+ break ;
446+ }
447+
448+ list_for_each_entry (trans , & net -> nft .commit_list , list ) {
449+ if (trans -> ctx .family != NFPROTO_NETDEV )
450+ continue ;
451+
452+ switch (trans -> msg_type ) {
453+ case NFT_MSG_NEWRULE :
454+ if (!(trans -> ctx .chain -> flags & NFT_CHAIN_HW_OFFLOAD ))
455+ continue ;
456+
457+ nft_flow_rule_destroy (nft_trans_flow_rule (trans ));
458+ break ;
459+ default :
460+ break ;
461+ }
446462 }
447463
448464 return err ;
You can’t perform that action at this time.
0 commit comments