netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* netfilter 02/02: xt_connlimit: fix regression caused by zero family value
@ 2009-11-05 18:23 Patrick McHardy
  2009-11-05 18:45 ` Jan Engelhardt
  0 siblings, 1 reply; 7+ messages in thread
From: Patrick McHardy @ 2009-11-05 18:23 UTC (permalink / raw)
  To: David S. Miller; +Cc: Netfilter Development Mailinglist, Linux Netdev List

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 02.diff --]
[-- Type: text/x-patch, Size: 2010 bytes --]

commit 0b3645af59740e4da29a18b96d8eaf68ddd2cea4
Author: Jan Engelhardt <jengelh@medozas.de>
Date:   Thu Nov 5 15:02:25 2009 +0100

    netfilter: xt_connlimit: fix regression caused by zero family value
    
    Commit v2.6.28-rc1~7172~1092~2 was slightly incomplete; not all
    instances of par->match->family were changed to par->family.
    
    Netfilter bugzilla #610.
    
    Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c
index 6809809..38f03f7 100644
--- a/net/netfilter/xt_connlimit.c
+++ b/net/netfilter/xt_connlimit.c
@@ -103,7 +103,7 @@ static int count_them(struct xt_connlimit_data *data,
 		      const struct nf_conntrack_tuple *tuple,
 		      const union nf_inet_addr *addr,
 		      const union nf_inet_addr *mask,
-		      const struct xt_match *match)
+		      u_int8_t family)
 {
 	const struct nf_conntrack_tuple_hash *found;
 	struct xt_connlimit_conn *conn;
@@ -113,8 +113,7 @@ static int count_them(struct xt_connlimit_data *data,
 	bool addit = true;
 	int matches = 0;
 
-
-	if (match->family == NFPROTO_IPV6)
+	if (family == NFPROTO_IPV6)
 		hash = &data->iphash[connlimit_iphash6(addr, mask)];
 	else
 		hash = &data->iphash[connlimit_iphash(addr->ip & mask->ip)];
@@ -157,8 +156,7 @@ static int count_them(struct xt_connlimit_data *data,
 			continue;
 		}
 
-		if (same_source_net(addr, mask, &conn->tuple.src.u3,
-		    match->family))
+		if (same_source_net(addr, mask, &conn->tuple.src.u3, family))
 			/* same source network -> be counted! */
 			++matches;
 		nf_ct_put(found_ct);
@@ -207,7 +205,7 @@ connlimit_mt(const struct sk_buff *skb, const struct xt_match_param *par)
 
 	spin_lock_bh(&info->data->lock);
 	connections = count_them(info->data, tuple_ptr, &addr,
-	                         &info->mask, par->match);
+	                         &info->mask, par->family);
 	spin_unlock_bh(&info->data->lock);
 
 	if (connections < 0) {

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: netfilter 02/02: xt_connlimit: fix regression caused by zero family value
  2009-11-05 18:23 netfilter 02/02: xt_connlimit: fix regression caused by zero family value Patrick McHardy
@ 2009-11-05 18:45 ` Jan Engelhardt
  2009-11-06  8:44   ` David Miller
  2009-11-06 14:49   ` Patrick McHardy
  0 siblings, 2 replies; 7+ messages in thread
From: Jan Engelhardt @ 2009-11-05 18:45 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: David S. Miller, Netfilter Development Mailinglist,
	Linux Netdev List


On Thursday 2009-11-05 19:23, Patrick McHardy wrote:
>
>    netfilter: xt_connlimit: fix regression caused by zero family value
>    
>    Commit v2.6.28-rc1~7172~1092~2 was slightly incomplete; not all
>    instances of par->match->family were changed to par->family.
>    
>    Netfilter bugzilla #610.

Hold it.
git would never output ~7172~1092~2 because ~8266 would be much simpler.

I originally wrote "Commit v2.6.28-rc1~717^2~109^2~2", but one of your 
programs seems to eat commit messages or more.

(BTW, are not inline patches preferred for reply? Attachments do not 
automatically get quoted and I have to export it, reimport it, and
have it filtered through perl to add a >.)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: netfilter 02/02: xt_connlimit: fix regression caused by zero family value
  2009-11-05 18:45 ` Jan Engelhardt
@ 2009-11-06  8:44   ` David Miller
  2009-11-06 10:17     ` Jan Engelhardt
  2009-11-06 14:49   ` Patrick McHardy
  1 sibling, 1 reply; 7+ messages in thread
From: David Miller @ 2009-11-06  8:44 UTC (permalink / raw)
  To: jengelh; +Cc: kaber, netfilter-devel, netdev

From: Jan Engelhardt <jengelh@medozas.de>
Date: Thu, 5 Nov 2009 19:45:25 +0100 (CET)

> On Thursday 2009-11-05 19:23, Patrick McHardy wrote:
>>
>>    netfilter: xt_connlimit: fix regression caused by zero family value
>>    
>>    Commit v2.6.28-rc1~7172~1092~2 was slightly incomplete; not all
>>    instances of par->match->family were changed to par->family.
>>    
>>    Netfilter bugzilla #610.
> 
> Hold it.
> git would never output ~7172~1092~2 because ~8266 would be much simpler.
> 
> I originally wrote "Commit v2.6.28-rc1~717^2~109^2~2", but one of your 
> programs seems to eat commit messages or more.

Guys, please sort this out so I can add this fix to net-2.6

Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: netfilter 02/02: xt_connlimit: fix regression caused by zero family value
  2009-11-06  8:44   ` David Miller
@ 2009-11-06 10:17     ` Jan Engelhardt
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Engelhardt @ 2009-11-06 10:17 UTC (permalink / raw)
  To: David Miller; +Cc: kaber, netfilter-devel, netdev


On Friday 2009-11-06 09:44, David Miller wrote:

>From: Jan Engelhardt <jengelh@medozas.de>
>Date: Thu, 5 Nov 2009 19:45:25 +0100 (CET)
>
>> On Thursday 2009-11-05 19:23, Patrick McHardy wrote:
>>>
>>>    netfilter: xt_connlimit: fix regression caused by zero family value
>>>    
>>>    Commit v2.6.28-rc1~7172~1092~2 was slightly incomplete; not all
>>>    instances of par->match->family were changed to par->family.
>>>    
>>>    Netfilter bugzilla #610.
>> 
>> Hold it.
>> git would never output ~7172~1092~2 because ~8266 would be much simpler.
>> 
>> I originally wrote "Commit v2.6.28-rc1~717^2~109^2~2", but one of your 
>> programs seems to eat commit messages or more.
>
>Guys, please sort this out so I can add this fix to net-2.6
>
>Thanks.

This should.


commit ffffffffffffffffffffffffffffffffffffffff
Author: Jan Engelhardt <jengelh@medozas.de>
Date:   Wed Nov 4 14:27:30 2009 +0100

netfilter: xt_connlimit: fix regression caused by zero family value
Commit v2.6.28-rc1~717^2~109^2~2 was slightly incomplete; not all
instances of par->match->family were changed to par->family.

References: http://bugzilla.netfilter.org/show_bug.cgi?id=610
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
 net/netfilter/xt_connlimit.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c
index 6809809..38f03f7 100644
--- a/net/netfilter/xt_connlimit.c
+++ b/net/netfilter/xt_connlimit.c
@@ -103,7 +103,7 @@ static int count_them(struct xt_connlimit_data *data,
 		      const struct nf_conntrack_tuple *tuple,
 		      const union nf_inet_addr *addr,
 		      const union nf_inet_addr *mask,
-		      const struct xt_match *match)
+		      u_int8_t family)
 {
 	const struct nf_conntrack_tuple_hash *found;
 	struct xt_connlimit_conn *conn;
@@ -113,8 +113,7 @@ static int count_them(struct xt_connlimit_data *data,
 	bool addit = true;
 	int matches = 0;
 
-
-	if (match->family == NFPROTO_IPV6)
+	if (family == NFPROTO_IPV6)
 		hash = &data->iphash[connlimit_iphash6(addr, mask)];
 	else
 		hash = &data->iphash[connlimit_iphash(addr->ip & mask->ip)];
@@ -157,8 +156,7 @@ static int count_them(struct xt_connlimit_data *data,
 			continue;
 		}
 
-		if (same_source_net(addr, mask, &conn->tuple.src.u3,
-		    match->family))
+		if (same_source_net(addr, mask, &conn->tuple.src.u3, family))
 			/* same source network -> be counted! */
 			++matches;
 		nf_ct_put(found_ct);
@@ -207,7 +205,7 @@ connlimit_mt(const struct sk_buff *skb, const struct xt_match_param *par)
 
 	spin_lock_bh(&info->data->lock);
 	connections = count_them(info->data, tuple_ptr, &addr,
-	                         &info->mask, par->match);
+	                         &info->mask, par->family);
 	spin_unlock_bh(&info->data->lock);
 
 	if (connections < 0) {
-- 
# Created with git-export-patch

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: netfilter 02/02: xt_connlimit: fix regression caused by zero family value
  2009-11-05 18:45 ` Jan Engelhardt
  2009-11-06  8:44   ` David Miller
@ 2009-11-06 14:49   ` Patrick McHardy
  2009-11-06 15:14     ` Eric Dumazet
  2009-11-07  2:08     ` David Miller
  1 sibling, 2 replies; 7+ messages in thread
From: Patrick McHardy @ 2009-11-06 14:49 UTC (permalink / raw)
  To: Jan Engelhardt
  Cc: David S. Miller, Netfilter Development Mailinglist,
	Linux Netdev List

Jan Engelhardt wrote:
> On Thursday 2009-11-05 19:23, Patrick McHardy wrote:
>>    netfilter: xt_connlimit: fix regression caused by zero family value
>>    
>>    Commit v2.6.28-rc1~7172~1092~2 was slightly incomplete; not all
>>    instances of par->match->family were changed to par->family.
>>    
>>    Netfilter bugzilla #610.
> 
> Hold it.
> git would never output ~7172~1092~2 because ~8266 would be much simpler.
> 
> I originally wrote "Commit v2.6.28-rc1~717^2~109^2~2", but one of your 
> programs seems to eat commit messages or more.

Indeed, my email client displays ^2 as ², which cut and paste transforms
to 2 :)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: netfilter 02/02: xt_connlimit: fix regression caused by zero family value
  2009-11-06 14:49   ` Patrick McHardy
@ 2009-11-06 15:14     ` Eric Dumazet
  2009-11-07  2:08     ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: Eric Dumazet @ 2009-11-06 15:14 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: Jan Engelhardt, David S. Miller,
	Netfilter Development Mailinglist, Linux Netdev List

Patrick McHardy a écrit :

> Indeed, my email client displays ^2 as ², which cut and paste transforms
> to 2 :)
>

One more Thunderbird addict^Wvictim :)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: netfilter 02/02: xt_connlimit: fix regression caused by zero family value
  2009-11-06 14:49   ` Patrick McHardy
  2009-11-06 15:14     ` Eric Dumazet
@ 2009-11-07  2:08     ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2009-11-07  2:08 UTC (permalink / raw)
  To: kaber; +Cc: jengelh, netfilter-devel, netdev

From: Patrick McHardy <kaber@trash.net>
Date: Fri, 06 Nov 2009 15:49:38 +0100

> Jan Engelhardt wrote:
>> On Thursday 2009-11-05 19:23, Patrick McHardy wrote:
>>>    netfilter: xt_connlimit: fix regression caused by zero family value
>>>    
>>>    Commit v2.6.28-rc1~7172~1092~2 was slightly incomplete; not all
>>>    instances of par->match->family were changed to par->family.
>>>    
>>>    Netfilter bugzilla #610.
>> 
>> Hold it.
>> git would never output ~7172~1092~2 because ~8266 would be much simpler.
>> 
>> I originally wrote "Commit v2.6.28-rc1~717^2~109^2~2", but one of your 
>> programs seems to eat commit messages or more.
> 
> Indeed, my email client displays ^2 as ², which cut and paste transforms
> to 2 :)

Ok, so I'll apply Jan's fixed up version, thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-11-07  2:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-05 18:23 netfilter 02/02: xt_connlimit: fix regression caused by zero family value Patrick McHardy
2009-11-05 18:45 ` Jan Engelhardt
2009-11-06  8:44   ` David Miller
2009-11-06 10:17     ` Jan Engelhardt
2009-11-06 14:49   ` Patrick McHardy
2009-11-06 15:14     ` Eric Dumazet
2009-11-07  2:08     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).