Commit Graph

38 Commits

Author SHA1 Message Date
Jan Engelhardt
d31067b32e Support for Linux 5.6 procfs API 2020-02-25 07:28:23 +01:00
Jan Engelhardt
a6289ec3ff build: silence compiler warning in xt_quota2
xt_quota2.c:67:6: warning: unused variable "ret" [-Wunused-variable]
2015-11-20 23:17:40 +01:00
Jan Engelhardt
237fe7c660 build: support for Linux 4.3 2015-10-12 16:27:08 +02:00
Sam Liddicott
939fc901c1 xt_quota2: allow incremental value to be written to quota proc file
As well as writing absolute numeric values to the quota file, you
can now also write numbers preceded by a + sign or a - sign, e.g.

* "+30" would increase the quota by 30
* "+-20" would increase the quota by negative 20,
  which is the same as decrease by 20
* "-5" would decrease the quota by 5
2015-09-29 20:54:18 +02:00
Daniel Golle
ae307c0bf3 xt_quota2: introduce support for network namespaces
Initialize a separate xt_quota2 instance for each network
namespace so data limit can be set and enforced per container.
2014-04-18 15:10:05 +02:00
Sam Liddicott
bc2bcc383c xt_quota2: remove trailing junk which might have a digit in it
Signed-off-by: Sam Liddicott <sam@liddicott.com>
2014-01-09 10:00:43 +01:00
Sam Liddicott
c6c70ab30b xt_quota2: fix 2 bugs when not in grow mode
1. XT_QUOTA_NO_CHANGE should not alter quota to zero ever
2. XT_QUOTA_PACKET should not be set to zero based on skb->len

Signed-off-by: Sam Liddicott <sam@liddicott.com>
2014-01-09 09:59:04 +01:00
Jan Engelhardt
172bc7e306 xt_quota2: support for Linux 3.10 2013-06-18 08:09:18 +02:00
Jan Engelhardt
6fbb35d686 extensions: resolve compile error when CONFIG_UIDGID_STRICT_TYPE_CHECKS=y
xt_DNETMAP.c: In function "dnetmap_tg_check":
xt_DNETMAP.c:331:16: error: incompatible types when assigning to
type "kuid_t" from type "unsigned int"
xt_DNETMAP.c:332:16: error: incompatible types when assigning to
type "kgid_t" from type "unsigned int"
xt_DNETMAP.c:344:16: error: incompatible types when assigning to
type "kuid_t" from type "unsigned int"
xt_DNETMAP.c:345:16: error: incompatible types when assigning to
type "kgid_t" from type "unsigned int"
xt_condition.c: In function "condition_mt_check":
xt_condition.c:158:24: error: incompatible types when assigning to
type "kuid_t" from type "unsigned int"
xt_condition.c:159:24: error: incompatible types when assigning to
type "kgid_t" from type "unsigned int"
xt_quota2.c: In function "q2_get_counter":
xt_quota2.c:134:18: error: incompatible types when assigning to type
"kuid_t" from type "unsigned int"
xt_quota2.c:135:18: error: incompatible types when assigning to type
"kgid_t" from type "unsigned int"
2013-06-08 15:10:20 +02:00
Jan Engelhardt
5494bc40f4 Merge branch 'maint' into newage 2012-11-12 19:01:31 +01:00
Jan Engelhardt
bcdb7ed4e9 Update my email address
To ... none! Whatever is recent is in the git log.
2012-11-12 19:01:14 +01:00
Jan Engelhardt
78e47758c6 build: remove support for Linux 2.6.39 2012-11-12 18:30:49 +01:00
Jan Engelhardt
04d8ebe31c build: remove support for Linux 2.6.23 2012-10-16 04:16:56 +02:00
Jan Engelhardt
7cc774641a all: remove trailing squatspaces 2012-06-10 22:31:10 +02:00
Jan Engelhardt
076610e3af build: additional compilation fixes for Linux 3.2/3.3 2012-01-04 21:45:43 +01:00
Jan Engelhardt
2b671829d8 xt_quota2: license clarification
GPL3 did not exist back when Sam's xt_quota was written, therefore it
should be assumed that MODULE_LICENSE("GPL") intended to mean just
GPL2.
2011-11-30 11:41:04 +01:00
Jan Engelhardt
ec97cd6d89 build: add missing linux/version.h includes where needed
Reported-by: Sergei Zhirikov <sfzhi@yahoo.com>
References: http://marc.info/?l=netfilter-devel&m=131404939007827&w=2
2011-08-28 19:45:39 +02:00
Jan Engelhardt
1fed8bbf09 extensions: more precise description 2011-07-17 14:27:07 +02:00
Jan Engelhardt
9a18a05d02 compat_xtables: move to 2.6.35 xt_action_param (2/3) 2010-05-13 19:45:52 +02:00
Jan Engelhardt
5b472be9bb compat_xtables: move to 2.6.35 xt_action_param (1/3) 2010-05-13 19:28:37 +02:00
Jan Engelhardt
db717ec479 xt_quota2: reduce printf complexity 2010-05-13 15:39:29 +02:00
Jan Engelhardt
beb3358297 compat_xtables: move to 2.6.35 API for matches 2010-04-05 00:43:47 +02:00
Michael Farrell
7952a7d253 quota2: add a no-change mode
This commit adds an option to xt_quota2 called "no-change". The
effect of this option, when used, is that it will skip incrementing
or decrementing the quota counter, effectively providing a quota test
only.

The reason for implementing this is so that I could have a rule check
if quota is available for a rule in the PREROUTING tables, without
actually decrementing the amount of available quota. I only wanted to
decrement the amount of available quota in the FORWARD rule.
Otherwise, the first packet of every connection would be counted
twice.
2009-12-31 16:24:47 +01:00
Jan Engelhardt
5aee8738ed quota2: fix invalid page access in cleanup function 2009-08-07 10:35:52 +02:00
Jan Engelhardt
0d47cb8b37 quota2: direct-code XT_QUOTA_COUNTER_NAME_LENGTH 2009-07-10 17:21:12 +02:00
Jan Engelhardt
1c55aec64a quota2: use strtoull instead of strtoul 2009-07-10 17:18:48 +02:00
Jan Engelhardt
dd26ab476c quota2: extend locked period during cleanup 2009-07-04 02:11:25 +02:00
Jan Engelhardt
4bf667d8eb quota2: reduce memory footprint for anonymous counters
48/64 bytes (32/64-bit arch, resp.) per counter.
2009-07-04 01:53:35 +02:00
Jan Engelhardt
0a88bd3435 quota2: consolidate spinlocking calls 2009-07-04 01:31:13 +02:00
Jan Engelhardt
62fb261265 quota2: prefix internal struct name with xt_ 2009-07-04 01:29:32 +02:00
Jan Engelhardt
822c6bebe2 quota2: support nameless counters 2009-07-02 02:21:11 +02:00
kd6lvw
71812a2053 build: support for Linux 2.6.30
Fix a compile error with xt_quota2. Linux kernel commit
v2.6.29-7544-g3ba113d removed the "owner" member.
2009-06-12 03:41:00 +02:00
Jan Engelhardt
ee7e4f5a42 Update for Linux 2.6.28 2008-11-18 12:51:25 +01:00
Jan Engelhardt
be6fbee56a src: use NFPROTO_ constants 2008-11-18 11:57:14 +01:00
Jan Engelhardt
74880dd6ca Update license texts 2008-08-02 13:08:48 -04:00
Jan Engelhardt
e456c864c1 xt_quota2: support packet counting; add manpage 2008-07-07 01:19:10 +02:00
Jan Engelhardt
e987e2118c xt_quota2: allow for multiple rules to share one counter 2008-07-06 22:00:54 +02:00
Jan Engelhardt
a1e915a984 Add xt_quota2
Support for inversion, upcounting, and changing the quota/counter
through sysfs.
2008-07-06 22:00:54 +02:00