All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Dettling <m-dettling@gmx.de>
To: Henrik Nordstrom <hno@marasystems.com>
Cc: Netfilter Developers List <netfilter-devel@lists.netfilter.org>
Subject: Re: Reviewing a piece of code, locking questions
Date: Mon, 31 May 2004 01:33:34 +0200	[thread overview]
Message-ID: <40BA6F4E.1050706@gmx.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0405290048400.2189-101000@filer.marasystems.com>

Henrik Nordstrom wrote:

>On Fri, 28 May 2004, Matthias Dettling wrote:
>
>  
>
>>Can someone look at the code to see if there are any mistakes? 
>>Especially the parts with locking should be reviewed because I am really 
>>unsure if I have locked properly. Do I need a "WRITE_LOCK" or only a 
>>"READ_LOCK", is "&ip_conntrack_lock" right or need I 
>>"&ip_conntrack_expect_tuple" or even some other locking?
>>    
>>
>
>No obvious errors from what I could tell.
>
>You need a READ_LOCK.
>
>WRITE_LOCK is only needed if you are to modify the ip_conntrack table, 
>which you are obviously not doing.
>
>  
>
>>An other question I have is if it is legal to modifiy the structure 
>>"ipt_conntrack_info" in "ipt_conntrack.h" or could this cause problems 
>>or errors?
>>    
>>
>
>It is legal, but will invalidate binary compatibility with existing 
>iptables binaries having another libipt_conntrack compiled..
>
>  
>
>>I have added 2 arrays with the ports of the related connection for the 
>>matching as also extended the flag fields (see above).
>>    
>>
>
>To simplify the kernel code you could store the ports in network byte 
>order in the match structure.. this way you do not need to translate the 
>port fields while matching in the kernel.
>
>  
>
>>If all should be OK, how can I publish the modification, that it could 
>>be part of later versions of iptables and the kernel, because I think it 
>>could be interesting for others too?
>>    
>>
>
>As a tarball with the files to go into patch-o-matic-ng. This includes 
>both the patching to the kernel and userspace.
>
>  conntrack_port/	(or whatever you want to name your patch)
>	linux.patch	kernel changes
>	iptables.patch	userspace changes
>	info		meta info describing your patch
>	help		short blurb documenting your patch
>
>While you are at it you may want to also merge the other conntrack matches 
>I posted a long time ago.. [attached as a conntrack2 match]
>
>Regards
>Henrik
>  
>
Hello Henrik,

many thanks for your help.
This is what I meant, when saying "a patched version" of ipt_conntrack.c.
I found your patch on the net and applied it. So my work was only 
extending ipt_conntrack.c for matching tracked informations.
This means that my work depends on your patch because I use the same 
functions as your code does. I looked in the current CVS version of 
patch-o-matic about your patch as also in the file 
patch-o-matic-ng-20040302.tar.bz2 but didn't find it.
Because my work needs your patch am I allowed to add your patch to my 
patch (of course I would mention your name)?

You gave me the hint for simplifying kernel code storing the port 
numbers in network byte order. If I'm right I think that you don't do so 
in your patch. Because my work depends strongly on your it would be 
awkward to do so. But if it is really better for performance I could 
change the whole code in this way.

If I have created a patch as tarball where should I send this that it 
will be included in future releases of patch-o-matic?

Best regards
Matthias

  reply	other threads:[~2004-05-30 23:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-28 21:46 Reviewing a piece of code, locking questions Matthias Dettling
2004-05-28 22:59 ` Henrik Nordstrom
2004-05-30 23:33   ` Matthias Dettling [this message]
2004-05-31  8:36     ` Henrik Nordstrom
2004-06-08 17:31       ` conntrack matching Matthias Dettling
2004-06-08 18:03         ` Henrik Nordstrom
2004-06-08 18:21           ` Peter Stamfest

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=40BA6F4E.1050706@gmx.de \
    --to=m-dettling@gmx.de \
    --cc=hno@marasystems.com \
    --cc=netfilter-devel@lists.netfilter.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.