Skip to contentSkip to conversation

netfilter: nf_tables: skip transaction if no update flags in tables

PATCH New Pablo Neira Ayuso 1 participant 1 message Jun 27, 2014

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 netfilter: nf_tables: skip transaction if no update flags in tables

Skip transaction handling for table updates with no changes in the flags. This fixes a crash when passing the table flag with all bits unset.

---
 net/netfilter/nf_tables_api.c |    3 +++
 1 file changed, 3 insertions(+)
net/netfilter/nf_tables_api.c +3 -0
index ab4566c..da5dc37 100644
@@ -407,6 +407,9 @@ static int nf_tables_updtable(struct nft_ctx *ctx)
 	if (flags & ~NFT_TABLE_F_DORMANT)
 		return -EINVAL;
 
+	if (flags == ctx->table->flags)
+		return 0;
+
 	trans = nft_trans_alloc(ctx, NFT_MSG_NEWTABLE,
 				sizeof(struct nft_trans_table));
 	if (trans == NULL)
Signature · 1 line
1.7.10.4