aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMichal Miroslaw <mirq-linux@rere.qmqm.pl>2007-09-28 17:45:52 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:53:40 -0400
commit6b6ec99a03601aba0419f34e17630f7aa8d68e5f (patch)
treebe9d9cbb975ec7f1ed580154e9d7abe17a9020b7 /net
parentaace57e054e9322e20af52cede7de46ade64a5e2 (diff)
[NETFILTER]: nfnetlink_log: fix some constants
Fix timeout (one second is 1 * HZ) and convert max packet copy length to #defined constant. Signed-off-by: Michal Miroslaw <mirq-linux@rere.qmqm.pl> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nfnetlink_log.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 16ae53918606..2135926199ca 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -37,8 +37,9 @@
37#endif 37#endif
38 38
39#define NFULNL_NLBUFSIZ_DEFAULT NLMSG_GOODSIZE 39#define NFULNL_NLBUFSIZ_DEFAULT NLMSG_GOODSIZE
40#define NFULNL_TIMEOUT_DEFAULT 100 /* every second */ 40#define NFULNL_TIMEOUT_DEFAULT HZ /* every second */
41#define NFULNL_QTHRESH_DEFAULT 100 /* 100 packets */ 41#define NFULNL_QTHRESH_DEFAULT 100 /* 100 packets */
42#define NFULNL_COPY_RANGE_MAX 0xFFFF /* max packet size is limited by 16-bit struct nfattr nfa_len field */
42 43
43#define PRINTR(x, args...) do { if (net_ratelimit()) \ 44#define PRINTR(x, args...) do { if (net_ratelimit()) \
44 printk(x, ## args); } while (0); 45 printk(x, ## args); } while (0);
@@ -171,7 +172,7 @@ instance_create(u_int16_t group_num, int pid)
171 inst->flushtimeout = NFULNL_TIMEOUT_DEFAULT; 172 inst->flushtimeout = NFULNL_TIMEOUT_DEFAULT;
172 inst->nlbufsiz = NFULNL_NLBUFSIZ_DEFAULT; 173 inst->nlbufsiz = NFULNL_NLBUFSIZ_DEFAULT;
173 inst->copy_mode = NFULNL_COPY_PACKET; 174 inst->copy_mode = NFULNL_COPY_PACKET;
174 inst->copy_range = 0xffff; 175 inst->copy_range = NFULNL_COPY_RANGE_MAX;
175 176
176 hlist_add_head(&inst->hlist, 177 hlist_add_head(&inst->hlist,
177 &instance_table[instance_hashfn(group_num)]); 178 &instance_table[instance_hashfn(group_num)]);
@@ -235,11 +236,8 @@ nfulnl_set_mode(struct nfulnl_instance *inst, u_int8_t mode,
235 236
236 case NFULNL_COPY_PACKET: 237 case NFULNL_COPY_PACKET:
237 inst->copy_mode = mode; 238 inst->copy_mode = mode;
238 /* we're using struct nlattr which has 16bit nfa_len */ 239 inst->copy_range = min_t(unsigned int,
239 if (range > 0xffff) 240 range, NFULNL_COPY_RANGE_MAX);
240 inst->copy_range = 0xffff;
241 else
242 inst->copy_range = range;
243 break; 241 break;
244 242
245 default: 243 default: