From: Pablo Neira <pablo@eurodev.net>
To: sjean@cookinglinux.org
Cc: Harald Welte <laforge@netfilter.org>,
netfilter-devel@lists.netfilter.org, jamal <hadi@cyberus.ca>,
Patrick McHardy <kaber@trash.net>, John Hill <jhill@noach.com>
Subject: Re: [POSSIBLE PATCH] DECLARE_MUTEX while not in __KERNEL__ (Was: Re: [Fwd: RE: Second Request for help!!])
Date: Tue, 08 Feb 2005 01:17:08 +0100 [thread overview]
Message-ID: <42080504.2080606@eurodev.net> (raw)
In-Reply-To: <4207FF25.1060404@cookinglinux.org>
[-- Attachment #1: Type: text/plain, Size: 915 bytes --]
Samuel Jean wrote:
> I don't know if this patch breaks something, but at least am sure of
> something:
>
> Into ip_tables.h, DECLARE_MUTEX is used outside of __KERNEL__
> compilation.
> However, DECLARE_MUTEX exists only when #ifdef __KERNEL__
> according to asm/.../semaphore.h.
>
> I couldn't track when and why this semaphore had been introduced, but
> linux-2.4.26
> for sure doesn't use it.
======== include/linux/netfilter_ipv4/ip_tables.h 1.1..1.5 ========
D 1.5 04/06/06 20:13:18-07:00 hadi@zynx.com 6 5 8/0/447
P include/linux/netfilter_ipv4/ip_tables.h
C [NETFILTER]: Small interface cleanup for {ipt,ip6t,arpt}_find_target.
It seems that Jamal introduced this as a clean up some time ago. Maybe
because of an leftover intention of pushing forward ipt action in 2.4 ?
Anyway, I didn't find any client of ipt_mutex. I think it's better if we
move it to its original place, ip_tables.c.
--
Pablo
[-- Attachment #2: ip_tables-fix.patch --]
[-- Type: text/x-patch, Size: 931 bytes --]
===== net/ipv4/netfilter/ip_tables.c 1.16 vs ? (writable without lock!) =====
--- 1.16/net/ipv4/netfilter/ip_tables.c 2004-12-21 17:48:14 +01:00
+++ ?/net/ipv4/netfilter/ip_tables.c 2005-02-08 01:12:17 +01:00
@@ -53,6 +53,8 @@
#endif
#define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1))
+static DECLARE_MUTEX(ipt_mutex);
+
/* Must have mutex */
#define ASSERT_READ_LOCK(x) IP_NF_ASSERT(down_trylock(&ipt_mutex) != 0)
#define ASSERT_WRITE_LOCK(x) IP_NF_ASSERT(down_trylock(&ipt_mutex) != 0)
===== include/linux/netfilter_ipv4/ip_tables.h 1.5 vs ? (writable without lock!) =====
--- 1.5/include/linux/netfilter_ipv4/ip_tables.h 2004-06-07 05:13:18 +02:00
+++ ?/include/linux/netfilter_ipv4/ip_tables.h 2005-02-07 18:55:54 +01:00
@@ -336,7 +336,6 @@
/*
* Main firewall chains definitions and global var's definitions.
*/
-static DECLARE_MUTEX(ipt_mutex);
#ifdef __KERNEL__
#include <linux/init.h>
next prev parent reply other threads:[~2005-02-08 0:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-07 15:52 [Fwd: RE: Second Request for help!!] Samuel Jean
2005-02-07 23:52 ` [POSSIBLE PATCH] DECLARE_MUTEX while not in __KERNEL__ (Was: Re: [Fwd: RE: Second Request for help!!]) Samuel Jean
2005-02-08 0:17 ` Pablo Neira [this message]
2005-02-08 6:54 ` Patrick McHardy
2005-02-08 21:51 ` [PATCH] DECLARE_MUTEX in ip6_tables.h just like ip_tables.h Samuel Jean
2005-02-08 23:02 ` 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=42080504.2080606@eurodev.net \
--to=pablo@eurodev.net \
--cc=hadi@cyberus.ca \
--cc=jhill@noach.com \
--cc=kaber@trash.net \
--cc=laforge@netfilter.org \
--cc=netfilter-devel@lists.netfilter.org \
--cc=sjean@cookinglinux.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.