diff options
| author | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-06-10 04:53:01 -0400 |
|---|---|---|
| committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-06-16 07:07:44 -0400 |
| commit | a0a7379e16b6e4c229d082f24c7e3ef9e812ed46 (patch) | |
| tree | 5a7dc2ef6db3db90ae1a6807ebbaa6b9bdb627aa /include/net | |
| parent | 5bc5c307653cbf8fe9da6cbd8ae6c6bd5b86ff4b (diff) | |
netfilter: nf_tables: use u32 for chain use counter
Since 4fefee5 ("netfilter: nf_tables: allow to delete several objects
from a batch"), every new rule bumps the chain use counter. However,
this is limited to 16 bits, which means that it will overrun after
2^16 rules.
Use a u32 chain counter and check for overflows (just like we do for
table objects).
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/netfilter/nf_tables.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index 7ee6ce6564ae..713b0b88bd5a 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h | |||
| @@ -503,9 +503,9 @@ enum nft_chain_flags { | |||
| 503 | * @net: net namespace that this chain belongs to | 503 | * @net: net namespace that this chain belongs to |
| 504 | * @table: table that this chain belongs to | 504 | * @table: table that this chain belongs to |
| 505 | * @handle: chain handle | 505 | * @handle: chain handle |
| 506 | * @flags: bitmask of enum nft_chain_flags | ||
| 507 | * @use: number of jump references to this chain | 506 | * @use: number of jump references to this chain |
| 508 | * @level: length of longest path to this chain | 507 | * @level: length of longest path to this chain |
| 508 | * @flags: bitmask of enum nft_chain_flags | ||
| 509 | * @name: name of the chain | 509 | * @name: name of the chain |
| 510 | */ | 510 | */ |
| 511 | struct nft_chain { | 511 | struct nft_chain { |
| @@ -514,9 +514,9 @@ struct nft_chain { | |||
| 514 | struct net *net; | 514 | struct net *net; |
| 515 | struct nft_table *table; | 515 | struct nft_table *table; |
| 516 | u64 handle; | 516 | u64 handle; |
| 517 | u8 flags; | 517 | u32 use; |
| 518 | u16 use; | ||
| 519 | u16 level; | 518 | u16 level; |
| 519 | u8 flags; | ||
| 520 | char name[NFT_CHAIN_MAXNAMELEN]; | 520 | char name[NFT_CHAIN_MAXNAMELEN]; |
| 521 | }; | 521 | }; |
| 522 | 522 | ||
