Commit Graph

6 Commits

Author SHA1 Message Date
Jan Engelhardt
5e22c9c592 xt_ACCOUNT: avoid implicit padding in struct ipt_acc_handle_ip
Make the structure size so that an ILP32 environment has no problem
taking the raw bytes from an LP64 one.
2015-06-05 13:52:45 +02:00
Neal P. Murphy
1324442bce xt_ACCOUNT: make counters 64-bit wide
The Smoothwall Express traffic stats collector (traffiClogger) does
not handle counter rollovers well and does not perform read&flush.
(Yes, the code is somewhat aged.) To change it to perform read&flush
is non-trivial. Then, it occurred to me that it might be easier to
change ipt_ACCOUNT in xtables-addons to use 64-bit counters,
considering it was designed around single kernel pages.

The following submission counts to at least 100 GB, produces no
obvious kernel gripes, and adjacent counters do not seem to interfere
with each other. Yes, it uses more memory, but RAM costs much less
than bugs that grown out of complex software.

The theory:

  - Use two kernel pages for the counters for each group of 256
    addresses.
  - Change counters to 64-bit.
  - Change to __get_free_pages/free_pages, using order=2
    (two consecutive pages), and zero both pages.
  - Change "%u" to "%llu" as needed.
  - Everything else pretty much stays the same.

I also changed tmpbuf to two pages (Justin Case's idea), but I
do not know if that's really necessary.
2015-06-05 13:51:55 +02:00
Jan Engelhardt
351b040f4a ACCOUNT: avoid collision with arp_tables setsockopt numbers 2009-11-29 20:35:39 +01:00
Jan Engelhardt
0aa7be2f1d ACCOUNT: annotate source where BE is used 2009-10-30 18:42:40 +01:00
Jan Engelhardt
578af6f726 ACCOUNT: move private struct declarations into .c file 2009-10-27 11:04:23 +01:00
Jan Engelhardt
5cb36ed213 ACCOUNT: move xt_ACCOUNT into its own subdirectory
Will be adding related userspace programs shortly, and an extra
directory for the same reason it is for ipset/.
2009-09-24 01:00:15 +02:00