Commit Graph

734 Commits

Author SHA1 Message Date
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
01e7128a80 build: support for Linux 4.4 2015-11-20 23:17:39 +01:00
Jan Engelhardt
1dc2a1c2de xt_ACCOUNT: remove redundant braces
For single-line statements, the {} are not strictly needed.
2015-11-09 22:33:49 +01:00
Jan Engelhardt
60b6b1dbef xt_ACCOUNT: indent reduction
Invert early terminating conditions so the rest of the block can be
de-indented.
2015-11-09 22:33:49 +01:00
Neil P. Murphy
f89f10bbe9 xt_ACCOUNT: call free_pages(x,2)
Below is the patch with the *rest* of the free_page(X) calls changed
to free_pages(X, 2). xt_ACCOUNT should always allocate memory in page
pairs. And always *free* memory in page pairs.

References: http://www.spinics.net/lists/netfilter-devel/msg39025.html
2015-11-09 22:25:16 +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
Boris Figovsky
a4a077ff86 xt_DHCPMAC: correct L2addr set and compare 2015-09-29 20:40:24 +02:00
Jan Engelhardt
7e3e156d92 xt_ECHO: enable for all supported versions
Linux is now at 4.x.
2015-08-19 12:36:18 +02:00
Tim Gardner
8f70b9a99d build: support for Linux 4.2
xt_DNETMAP.c: In function "dnetmap_prefix_destroy":
xt_DNETMAP.c:185:2: error: implicit declaration of function
"remove_proc_entry" [-Werror=implicit-function-declaration]
  remove_proc_entry(p->proc_str_data, dnetmap_net->xt_dnetmap);
2015-08-19 12:35:01 +02:00
Alexander Petrenas
96ce5ec488 xt_TARPIT: support for Linux 4.1 2015-07-06 05:59:21 +02:00
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
Jan Engelhardt
01f97bfdd1 iptaccount: cast from uint64_t to please printf
%llu wants an "unsigned long long", which is not necessarily
the same as uint64_t.
2015-06-05 13:51:56 +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
Adam Butcher
c08835d65c xt_pknock: fix pknock in UDP SPA mode
When the PK_CRYPTO pre-processor flag got removed in
v1.47.1-2-g66f213e, one of the removal cases was misapplied; the body
of an "#ifndef PK_CRYPTO" was left in rather than the whole section
being removed.
2014-09-04 18:45:42 +02:00
Adam Butcher
4c21811919 src: work with typeof
Although not officially supported, we have found that the
xtables-addons modules we are interested in work fine on 3.0.4 with a
slight non-invasive mod to compat_xtables.h.
2014-09-04 18:44:52 +02:00
Jan Engelhardt
87adf3461f build: resolve compile error with Linux 3.15
Commit v3.15-rc1~141^2~97 changed the signature for cn_netlink_send.
2014-04-18 19:12:51 +02:00
Jan Engelhardt
f2e21e67a5 build: resolve compile error with Linux 3.13
net_random has been removed in commit v3.14-rc1~94^2~191 and replaced
by its definition, prandom_u32.

prandom_u32 was only introduced in v3.8-rc1~74^2~22, so we will have
an extra ifdef for 3.7 support.
2014-04-18 19:12:40 +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
Jan Engelhardt
991c0cf4cf compat_xtables: remove no longer needed target API redirection
Function signature for targets stayed the same since 3.7.
2014-01-09 10:24:32 +01:00
Jan Engelhardt
b58e78968e compat_xtables: remove unused compat_nfinetaddr.h header 2014-01-09 10:19:48 +01:00
Jan Engelhardt
02eb0e5df9 compat_xtables: remove unused function declarations 2014-01-09 10:19:00 +01:00
Jan Engelhardt
98ea6c538b compat_xtables: remove unused ipt_unregister_table macro 2014-01-09 10:16:42 +01:00
Jan Engelhardt
7cf7250e07 compat_xtables: remove unused xtnu_ip_route_me_harder 2014-01-09 10:16:02 +01:00
Jan Engelhardt
f9b0ee7533 compat_xtables: remove unused xtnu_skb_make_writable 2014-01-09 10:14:36 +01:00
Jan Engelhardt
a82d0ba517 compat_xtables: remove unused xtnu_request_find_match
The xt_find_match function is also getting unexported in 3.14.
2014-01-09 10:09:04 +01: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
9414a5df34 extensions: remove RAWSNAT/RAWDNAT 2013-08-07 15:42:56 +02:00
Jan Engelhardt
f28cfff138 extensions: remove STEAL target
There is enough demo code in the "demos" branch.
2013-08-07 15:40:24 +02:00
Jan Engelhardt
3bf7ebc48c xt_pknock: support for Linux 3.10 2013-06-18 08:09:18 +02:00
Jan Engelhardt
172bc7e306 xt_quota2: support for Linux 3.10 2013-06-18 08:09:18 +02:00
Jan Engelhardt
db45bbcb9e xt_condition: support for Linux 3.10 2013-06-18 08:09:18 +02:00
Jan Engelhardt
b2cd0ab65b xt_DNETMAP: support for Linux 3.10 2013-06-18 08:09:16 +02:00
Jan Engelhardt
b5a2f9aa14 compat_xtables: dissolve unusued rt_dst 2013-06-08 15:27:34 +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
2b38d081a5 doc: spelling and grammar corrections to DNETMAP 2013-06-02 17:13:25 +02:00
Jan Engelhardt
fda591dba4 doc: replace apostrophes by proper situation-dependent puncutation 2013-06-02 16:59:44 +02:00
Jan Engelhardt
9de3027c02 doc: dissolve contractions 2013-06-02 16:59:14 +02:00
Jan Engelhardt
2dc8f21476 doc: more escapes for minuses 2013-06-02 16:57:50 +02:00
Jan Engelhardt
e027089782 doc: markup paragraphs 2013-06-02 16:53:56 +02:00
Dmitry Smirnov
fe7a30c746 doc: lint man pages (hyphens and spelling)
* hyphen-used-as-minus-sign
* spelling-error-in-manpage
2013-06-02 16:49:12 +02:00
Jan Engelhardt
13db8d78c9 extensions: make print (iptables -L) output the same as save (-S) 2013-05-30 17:16:56 +02:00
Денис Устименко
6a60b5ab75 xt_quota2: print "!" at the correct position during iptables-save 2013-05-30 17:04:47 +02:00
Jan Engelhardt
d48a5fe0f4 xt_geoip: do not throw a warnings when country database is size 0 2013-05-30 17:00:25 +02:00
Dmitry Popov
b70905e7cb xt_RAWNAT: skb writable part might not include whole L4 header (IPv4 case)
Consider TCP/IPv4 packet with IP options: sizeof(*iph) + sizeof(struct
tcphdr) is not enough to include tcp checksum. It may hurt if this
packet is fragmented.

Therefore, we should use iph->ihl * 4 instead of sizeof(*iph).

Signed-off-by: Dmitry Popov <dp@highloadlab.com>
2013-05-08 13:21:54 +02:00
Jan Engelhardt
d96fff8893 DELUDE: update comment about reentrancy 2013-03-31 21:11:25 +02:00
Jan Engelhardt
aceca54912 iptaccount: fix being a no-op program
A PPC system has been observed where "char" is unsigned; with that,
the getopt loop will never terminate because optchar != -1 could not
happen.
2013-03-31 21:11:24 +02:00
Jan Engelhardt
cb1cdb190f build: support for Linux 3.9 2013-03-07 22:56:27 +01:00
Jan Engelhardt
57c3cc1722 build: support for Linux 3.8 2012-12-27 07:59:34 +01:00