All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Dmitry Mishin <dim@openvz.org>
Cc: sparclinux@vger.kernel.org,
	Netfilter Developer Mailing List
	<netfilter-devel@lists.netfilter.org>,
	Jan Engelhardt <jengelh@linux01.gwdg.de>
Subject: Re: iptables throws unknown error - suspecting 32/64 compat issue
Date: Tue, 05 Jun 2007 15:32:38 +0200	[thread overview]
Message-ID: <466565F6.7070902@trash.net> (raw)
In-Reply-To: <4665542F.9020607@trash.net>

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

Patrick McHardy wrote:
> Dmitry Mishin wrote:
> 
>>It's better, but I see the issue with iterate with compat_check_entry() calls.
>>If it fails, some of target/matches' check_* functions are called, some not.
>>Please, review my version of this patch.
> 
> 
> 
> You're right again, thanks. Patch applied.
> 

With one minor change:


[-- Attachment #2: x --]
[-- Type: text/plain, Size: 915 bytes --]

diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 9c294a5..e992cd6 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -265,14 +265,17 @@ ipt_get_target(struct ipt_entry *e)
 })
 
 /* fn returns 0 to continue iteration */
-#define IPT_ENTRY_ITERATE_CONTINUE(entries, size, i, fn, args...) \
+#define IPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \
 ({								\
-	unsigned int __i;					\
+	unsigned int __i, __n;					\
 	int __ret = 0;						\
 	struct ipt_entry *__entry;				\
 								\
-	for (__i = i; __i < (size); __i += __entry->next_offset) { \
+	for (__i = 0, __n = 0; __i < (size);			\
+	     __i += __entry->next_offset, __n++) { 		\
 		__entry = (void *)(entries) + __i;		\
+		if (__n < n)					\
+			continue;				\
 								\
 		__ret = fn(__entry , ## args);			\
 		if (__ret != 0)					\

WARNING: multiple messages have this Message-ID (diff)
From: Patrick McHardy <kaber@trash.net>
To: Dmitry Mishin <dim@openvz.org>
Cc: sparclinux@vger.kernel.org,
	Netfilter Developer Mailing List
	<netfilter-devel@lists.netfilter.org>,
	Jan Engelhardt <jengelh@linux01.gwdg.de>
Subject: Re: iptables throws unknown error - suspecting 32/64 compat issue
Date: Tue, 05 Jun 2007 13:32:38 +0000	[thread overview]
Message-ID: <466565F6.7070902@trash.net> (raw)
In-Reply-To: <4665542F.9020607@trash.net>

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

Patrick McHardy wrote:
> Dmitry Mishin wrote:
> 
>>It's better, but I see the issue with iterate with compat_check_entry() calls.
>>If it fails, some of target/matches' check_* functions are called, some not.
>>Please, review my version of this patch.
> 
> 
> 
> You're right again, thanks. Patch applied.
> 

With one minor change:


[-- Attachment #2: x --]
[-- Type: text/plain, Size: 915 bytes --]

diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 9c294a5..e992cd6 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -265,14 +265,17 @@ ipt_get_target(struct ipt_entry *e)
 })
 
 /* fn returns 0 to continue iteration */
-#define IPT_ENTRY_ITERATE_CONTINUE(entries, size, i, fn, args...) \
+#define IPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \
 ({								\
-	unsigned int __i;					\
+	unsigned int __i, __n;					\
 	int __ret = 0;						\
 	struct ipt_entry *__entry;				\
 								\
-	for (__i = i; __i < (size); __i += __entry->next_offset) { \
+	for (__i = 0, __n = 0; __i < (size);			\
+	     __i += __entry->next_offset, __n++) { 		\
 		__entry = (void *)(entries) + __i;		\
+		if (__n < n)					\
+			continue;				\
 								\
 		__ret = fn(__entry , ## args);			\
 		if (__ret != 0)					\

  reply	other threads:[~2007-06-05 13:32 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-10  6:27 iptables throws unknown error - suspecting 32/64 compat issue Jan Engelhardt
2007-05-10  6:27 ` Jan Engelhardt
2007-05-10  6:34 ` Jan Engelhardt
2007-05-10  6:34   ` Jan Engelhardt
2007-05-10  7:16   ` David Miller
2007-05-10  7:16     ` David Miller
2007-05-10 13:20   ` Patrick McHardy
2007-05-10 13:20     ` Patrick McHardy
2007-05-10 13:24     ` Jan Engelhardt
2007-05-10 13:24       ` Jan Engelhardt
2007-05-10 14:02       ` Patrick McHardy
2007-05-10 14:02         ` Patrick McHardy
2007-05-10 14:05         ` Jan Engelhardt
2007-05-10 14:05           ` Jan Engelhardt
2007-05-29 21:36           ` Jan Engelhardt
2007-05-29 21:36             ` Jan Engelhardt
2007-05-29 22:29             ` Patrick McHardy
2007-05-29 22:29               ` Patrick McHardy
2007-06-02 12:54               ` Patrick McHardy
2007-06-02 12:54                 ` Patrick McHardy
2007-06-02 13:29                 ` Jan Engelhardt
2007-06-02 13:29                   ` Jan Engelhardt
2007-06-02 13:53                   ` Patrick McHardy
2007-06-02 13:53                     ` Patrick McHardy
2007-06-02 14:25                 ` Jan Engelhardt
2007-06-02 14:25                   ` Jan Engelhardt
2007-06-02 14:43                   ` Patrick McHardy
2007-06-02 14:43                     ` Patrick McHardy
2007-06-03  6:47                 ` Dmitry Mishin
2007-06-03  6:47                   ` Dmitry Mishin
2007-06-03 16:57                   ` Patrick McHardy
2007-06-03 16:57                     ` Patrick McHardy
2007-06-03 17:29                     ` Jan Engelhardt
2007-06-03 17:29                       ` Jan Engelhardt
2007-06-03 17:31                       ` Patrick McHardy
2007-06-03 17:31                         ` Patrick McHardy
2007-06-03 18:11                         ` Jan Engelhardt
2007-06-03 18:11                           ` Jan Engelhardt
2007-06-04  7:54                     ` Dmitry Mishin
2007-06-04  7:54                       ` Dmitry Mishin
2007-06-05 12:16                       ` Patrick McHardy
2007-06-05 12:16                         ` Patrick McHardy
2007-06-05 13:32                         ` Patrick McHardy [this message]
2007-06-05 13:32                           ` Patrick McHardy
2007-06-05 13:50                           ` Dmitry Mishin
2007-06-05 13:50                             ` Dmitry Mishin
2007-05-10 12:58 ` Patrick McHardy
2007-05-10 12:58   ` Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=466565F6.7070902@trash.net \
    --to=kaber@trash.net \
    --cc=dim@openvz.org \
    --cc=jengelh@linux01.gwdg.de \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.