All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Joakim Axelsson <gozem@gozem.se>
Cc: Massimiliano Hofer <max@nucleus.it>,
	Netfilter Development Mailinglist
	<netfilter-devel@lists.netfilter.org>
Subject: Re: priv_data patch
Date: Mon, 14 Aug 2006 18:01:19 +0200	[thread overview]
Message-ID: <44E09E4F.3040506@trash.net> (raw)
In-Reply-To: <20060814155642.GA15328@kriss.csbnet.se>

Joakim Axelsson wrote:
> 2006-08-14 17:46:59+0200, Patrick McHardy <kaber@trash.net> ->
> 
>>Thats not true, the master pointer is reinitialized on every change by
>>the checkentry function (which, as you note, is called on all rules for
>>every change). The simple reason why it keeps its current state is
>>because it is dumped to userspace and echoed back. If you move it out of
>>the structure shared with userspace, this can not happen anymore.
> 
> 
> I think we define reinitiated differently then. I define reinitated by
> checkentry() being runned even tho the match/rule isn't a new (or altered)
> match/rule. 
> 
> If checkentry() is runned for _all_ matches/targers everytime an unrelated
> rule is altered then limit will lose its state because the code resets the
> bucket and refills it.


You're right. That is actually a bug in my opinion.

> Meaning that if I have a limit of 1 packet each hour
> and I change an (unrelated) rule every 30mins the limit will be a limit of 1
> packet every 30min instead. The (ugly) workaround i posted will solve this
> issue by keeping track if it has been running the checkentry() before. This
> is where the priv_data is needed.


No, we can simply check if f.e. credit is non-zero.

> But if you say that the priv_data pointer will be lost for all rules on any
> alter of rules its kinda void to have it. However a solution keeping that
> priv_data pointer intact could be very useful. 


That would mean the kernel needs to associate new rules with rules in
the old table (or the individual modules itself need to do it somehow,
like hashlimit or recent). This is really getting too ugly to even
consider in my opinion, especially since the obvious solution of not
doing an atomic table exchange also solves a lot of other problems.

  reply	other threads:[~2006-08-14 16:01 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-14 13:34 priv_data patch Patrick McHardy
2006-08-14 14:25 ` Joakim Axelsson
2006-08-14 14:31   ` Patrick McHardy
2006-08-14 15:20     ` Joakim Axelsson
2006-08-14 15:28       ` Patrick McHardy
2006-08-14 16:04         ` Joakim Axelsson
2006-08-14 16:13           ` Patrick McHardy
2006-08-14 16:55             ` Joakim Axelsson
2006-08-14 16:59               ` Patrick McHardy
2006-08-15  8:27               ` Amin Azez
2006-08-15  8:40                 ` Joakim Axelsson
2006-08-14 15:31       ` Patrick McHardy
2006-08-14 15:40         ` Joakim Axelsson
2006-08-14 15:46           ` Patrick McHardy
2006-08-14 15:56             ` Joakim Axelsson
2006-08-14 16:01               ` Patrick McHardy [this message]
2006-08-14 16:13                 ` Joakim Axelsson
2006-08-14 16:26                   ` Patrick McHardy
2006-08-14 16:40                     ` Joakim Axelsson
2006-08-14 16:50                       ` Patrick McHardy
2006-08-14 17:11                         ` Joakim Axelsson
2006-08-14 17:48                           ` Patrick McHardy
2006-08-14 17:59                             ` Joakim Axelsson
2006-08-14 15:53       ` Massimiliano Hofer
2006-08-14 14:40 ` Massimiliano Hofer
2006-08-14 14:48   ` Patrick McHardy
2006-08-14 14:58     ` Joakim Axelsson
2006-08-14 15:05       ` Patrick McHardy
2006-08-14 16:19     ` Massimiliano Hofer
2006-08-14 16:32       ` Joakim Axelsson
     [not found] ` <200608141557.35918.max@nucleus.it>
     [not found]   ` <44E08AC7.2050204@trash.net>
     [not found]     ` <200608141702.50753.max@nucleus.it>
2006-08-14 15:14       ` 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=44E09E4F.3040506@trash.net \
    --to=kaber@trash.net \
    --cc=gozem@gozem.se \
    --cc=max@nucleus.it \
    --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.