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)
422
422
continue ;
423
423
424
424
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
+ }
428
429
err = nft_flow_offload_rule (trans -> ctx .chain ,
429
430
nft_trans_rule (trans ),
430
431
nft_trans_flow_rule (trans ),
431
432
FLOW_CLS_REPLACE );
432
- nft_flow_rule_destroy (nft_trans_flow_rule (trans ));
433
433
break ;
434
434
case NFT_MSG_DELRULE :
435
435
if (!(trans -> ctx .chain -> flags & NFT_CHAIN_HW_OFFLOAD ))
@@ -442,7 +442,23 @@ int nft_flow_rule_offload_commit(struct net *net)
442
442
}
443
443
444
444
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
+ }
446
462
}
447
463
448
464
return err ;
You can’t perform that action at this time.
0 commit comments