<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/net/netfilter/xt_connbytes.c, branch v3.2</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>netfilter: xt_connbytes: handle negation correctly</title>
<updated>2011-12-23T13:50:19+00:00</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2011-12-16T17:35:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0354b48f633ae435acbc01b470a1ce8cfeff3e9f'/>
<id>0354b48f633ae435acbc01b470a1ce8cfeff3e9f</id>
<content type='text'>
"! --connbytes 23:42" should match if the packet/byte count is not in range.

As there is no explict "invert match" toggle in the match structure,
userspace swaps the from and to arguments
(i.e., as if "--connbytes 42:23" were given).

However, "what &lt;= 23 &amp;&amp; what &gt;= 42" will always be false.

Change things so we use "||" in case "from" is larger than "to".

This change may look like it breaks backwards compatibility when "to" is 0.
However, older iptables binaries will refuse "connbytes 42:0",
and current releases treat it to mean "! --connbytes 0:42",
so we should be fine.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
"! --connbytes 23:42" should match if the packet/byte count is not in range.

As there is no explict "invert match" toggle in the match structure,
userspace swaps the from and to arguments
(i.e., as if "--connbytes 42:23" were given).

However, "what &lt;= 23 &amp;&amp; what &gt;= 42" will always be false.

Change things so we use "||" in case "from" is larger than "to".

This change may look like it breaks backwards compatibility when "to" is 0.
However, older iptables binaries will refuse "connbytes 42:0",
and current releases treat it to mean "! --connbytes 0:42",
so we should be fine.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: xt_connbytes: Force CT accounting to be enabled</title>
<updated>2010-06-25T12:44:07+00:00</updated>
<author>
<name>Tim Gardner</name>
<email>tim.gardner@canonical.com</email>
</author>
<published>2010-06-25T12:44:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a8756201ba4189bca3ee1a6ec4e290f467ee09ab'/>
<id>a8756201ba4189bca3ee1a6ec4e290f467ee09ab</id>
<content type='text'>
Check at rule install time that CT accounting is enabled. Force it
to be enabled if not while also emitting a warning since this is not
the default state.

This is in preparation for deprecating CONFIG_NF_CT_ACCT upon which
CONFIG_NETFILTER_XT_MATCH_CONNBYTES depended being set.

Added 2 CT accounting support functions:

nf_ct_acct_enabled() - Get CT accounting state.
nf_ct_set_acct() - Enable/disable CT accountuing.

Signed-off-by: Tim Gardner &lt;tim.gardner@canonical.com&gt;
Acked-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Check at rule install time that CT accounting is enabled. Force it
to be enabled if not while also emitting a warning since this is not
the default state.

This is in preparation for deprecating CONFIG_NF_CT_ACCT upon which
CONFIG_NETFILTER_XT_MATCH_CONNBYTES depended being set.

Added 2 CT accounting support functions:

nf_ct_acct_enabled() - Get CT accounting state.
nf_ct_set_acct() - Enable/disable CT accountuing.

Signed-off-by: Tim Gardner &lt;tim.gardner@canonical.com&gt;
Acked-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: xtables: deconstify struct xt_action_param for matches</title>
<updated>2010-05-11T16:33:37+00:00</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@medozas.de</email>
</author>
<published>2009-07-07T18:42:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=62fc8051083a334578c3f4b3488808f210b4565f'/>
<id>62fc8051083a334578c3f4b3488808f210b4565f</id>
<content type='text'>
In future, layer-3 matches will be an xt module of their own, and
need to set the fragoff and thoff fields. Adding more pointers would
needlessy increase memory requirements (esp. so for 64-bit, where
pointers are wider).

Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In future, layer-3 matches will be an xt module of their own, and
need to set the fragoff and thoff fields. Adding more pointers would
needlessy increase memory requirements (esp. so for 64-bit, where
pointers are wider).

Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: xtables: substitute temporary defines by final name</title>
<updated>2010-05-11T16:31:17+00:00</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@medozas.de</email>
</author>
<published>2009-07-05T17:43:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4b560b447df83368df44bd3712c0c39b1d79ba04'/>
<id>4b560b447df83368df44bd3712c0c39b1d79ba04</id>
<content type='text'>
Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: xtables: shorten up return clause</title>
<updated>2010-03-25T15:56:09+00:00</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@medozas.de</email>
</author>
<published>2010-03-21T03:05:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f95c74e33eff5e3fe9798e2dc0a7749150ea3f80'/>
<id>f95c74e33eff5e3fe9798e2dc0a7749150ea3f80</id>
<content type='text'>
The return value of nf_ct_l3proto_get can directly be returned even in
the case of success.

Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The return value of nf_ct_l3proto_get can directly be returned even in
the case of success.

Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: xtables: slightly better error reporting</title>
<updated>2010-03-25T15:56:09+00:00</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@medozas.de</email>
</author>
<published>2010-03-19T16:32:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4a5a5c73b7cfee46a0b1411903cfa0dea532deec'/>
<id>4a5a5c73b7cfee46a0b1411903cfa0dea532deec</id>
<content type='text'>
When extended status codes are available, such as ENOMEM on failed
allocations, or subsequent functions (e.g. nf_ct_get_l3proto), passing
them up to userspace seems like a good idea compared to just always
EINVAL.

Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When extended status codes are available, such as ENOMEM on failed
allocations, or subsequent functions (e.g. nf_ct_get_l3proto), passing
them up to userspace seems like a good idea compared to just always
EINVAL.

Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: xtables: change matches to return error code</title>
<updated>2010-03-25T15:55:24+00:00</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@medozas.de</email>
</author>
<published>2010-03-23T15:35:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bd414ee605ff3ac5fcd79f57269a897879ee4cde'/>
<id>bd414ee605ff3ac5fcd79f57269a897879ee4cde</id>
<content type='text'>
The following semantic patch does part of the transformation:
// &lt;smpl&gt;
@ rule1 @
struct xt_match ops;
identifier check;
@@
 ops.checkentry = check;

@@
identifier rule1.check;
@@
 check(...) { &lt;...
-return true;
+return 0;
 ...&gt; }

@@
identifier rule1.check;
@@
 check(...) { &lt;...
-return false;
+return -EINVAL;
 ...&gt; }
// &lt;/smpl&gt;

Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following semantic patch does part of the transformation:
// &lt;smpl&gt;
@ rule1 @
struct xt_match ops;
identifier check;
@@
 ops.checkentry = check;

@@
identifier rule1.check;
@@
 check(...) { &lt;...
-return true;
+return 0;
 ...&gt; }

@@
identifier rule1.check;
@@
 check(...) { &lt;...
-return false;
+return -EINVAL;
 ...&gt; }
// &lt;/smpl&gt;

Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: xtables: change xt_match.checkentry return type</title>
<updated>2010-03-25T15:03:13+00:00</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@medozas.de</email>
</author>
<published>2010-03-19T16:16:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b0f38452ff73da7e9e0ddc68cd5c6b93c897ca0d'/>
<id>b0f38452ff73da7e9e0ddc68cd5c6b93c897ca0d</id>
<content type='text'>
Restore function signatures from bool to int so that we can report
memory allocation failures or similar using -ENOMEM rather than
always having to pass -EINVAL back.

This semantic patch may not be too precise (checking for functions
that use xt_mtchk_param rather than functions referenced by
xt_match.checkentry), but reviewed, it produced the intended result.

// &lt;smpl&gt;
@@
type bool;
identifier check, par;
@@
-bool check
+int check
 (struct xt_mtchk_param *par) { ... }
// &lt;/smpl&gt;

Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Restore function signatures from bool to int so that we can report
memory allocation failures or similar using -ENOMEM rather than
always having to pass -EINVAL back.

This semantic patch may not be too precise (checking for functions
that use xt_mtchk_param rather than functions referenced by
xt_match.checkentry), but reviewed, it produced the intended result.

// &lt;smpl&gt;
@@
type bool;
identifier check, par;
@@
-bool check
+int check
 (struct xt_mtchk_param *par) { ... }
// &lt;/smpl&gt;

Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: xt extensions: use pr_&lt;level&gt;</title>
<updated>2010-03-18T13:20:07+00:00</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@medozas.de</email>
</author>
<published>2010-03-17T15:04:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8bee4bad03c5b601bd6cea123c31025680587ccc'/>
<id>8bee4bad03c5b601bd6cea123c31025680587ccc</id>
<content type='text'>
Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: xtables: cut down on static data for family-independent extensions</title>
<updated>2008-10-08T09:35:20+00:00</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@medozas.de</email>
</author>
<published>2008-10-08T09:35:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=92f3b2b1bc968caaabee8cd78bee75ab7c4af74e'/>
<id>92f3b2b1bc968caaabee8cd78bee75ab7c4af74e</id>
<content type='text'>
Using -&gt;family in struct xt_*_param, multiple struct xt_{match,target}
can be squashed together.

Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using -&gt;family in struct xt_*_param, multiple struct xt_{match,target}
can be squashed together.

Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
Signed-off-by: Patrick McHardy &lt;kaber@trash.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
