@@ -8626,26 +8626,38 @@ EXPORT_SYMBOL_GPL(nft_chain_validate_hooks);
8626
8626
static int nf_tables_check_loops (const struct nft_ctx * ctx ,
8627
8627
const struct nft_chain * chain );
8628
8628
8629
+ static int nft_check_loops (const struct nft_ctx * ctx ,
8630
+ const struct nft_set_ext * ext )
8631
+ {
8632
+ const struct nft_data * data ;
8633
+ int ret ;
8634
+
8635
+ data = nft_set_ext_data (ext );
8636
+ switch (data -> verdict .code ) {
8637
+ case NFT_JUMP :
8638
+ case NFT_GOTO :
8639
+ ret = nf_tables_check_loops (ctx , data -> verdict .chain );
8640
+ break ;
8641
+ default :
8642
+ ret = 0 ;
8643
+ break ;
8644
+ }
8645
+
8646
+ return ret ;
8647
+ }
8648
+
8629
8649
static int nf_tables_loop_check_setelem (const struct nft_ctx * ctx ,
8630
8650
struct nft_set * set ,
8631
8651
const struct nft_set_iter * iter ,
8632
8652
struct nft_set_elem * elem )
8633
8653
{
8634
8654
const struct nft_set_ext * ext = nft_set_elem_ext (set , elem -> priv );
8635
- const struct nft_data * data ;
8636
8655
8637
8656
if (nft_set_ext_exists (ext , NFT_SET_EXT_FLAGS ) &&
8638
8657
* nft_set_ext_flags (ext ) & NFT_SET_ELEM_INTERVAL_END )
8639
8658
return 0 ;
8640
8659
8641
- data = nft_set_ext_data (ext );
8642
- switch (data -> verdict .code ) {
8643
- case NFT_JUMP :
8644
- case NFT_GOTO :
8645
- return nf_tables_check_loops (ctx , data -> verdict .chain );
8646
- default :
8647
- return 0 ;
8648
- }
8660
+ return nft_check_loops (ctx , ext );
8649
8661
}
8650
8662
8651
8663
static int nf_tables_check_loops (const struct nft_ctx * ctx ,
0 commit comments