Skip to content

Commit e478075

Browse files
hgnkaber
authored andcommitted
netfilter: nf_conntrack: table max size should hold at least table size
Table size is defined as unsigned, wheres the table maximum size is defined as a signed integer. The calculation of max is 8 or 4, multiplied the table size. Therefore the max value is aligned to unsigned. Signed-off-by: Hagen Paul Pfeifer <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
1 parent 7845447 commit e478075

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/net/netfilter/nf_conntrack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ static inline int nf_ct_is_untracked(const struct sk_buff *skb)
287287

288288
extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp);
289289
extern unsigned int nf_conntrack_htable_size;
290-
extern int nf_conntrack_max;
290+
extern unsigned int nf_conntrack_max;
291291

292292
#define NF_CT_STAT_INC(net, count) \
293293
(per_cpu_ptr((net)->ct.stat, raw_smp_processor_id())->count++)

net/netfilter/nf_conntrack_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ EXPORT_SYMBOL_GPL(nf_conntrack_lock);
5454
unsigned int nf_conntrack_htable_size __read_mostly;
5555
EXPORT_SYMBOL_GPL(nf_conntrack_htable_size);
5656

57-
int nf_conntrack_max __read_mostly;
57+
unsigned int nf_conntrack_max __read_mostly;
5858
EXPORT_SYMBOL_GPL(nf_conntrack_max);
5959

6060
struct nf_conn nf_conntrack_untracked __read_mostly;

0 commit comments

Comments
 (0)