From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick McHardy Subject: Re: Time match in mangle/POSTROUTING? Date: Wed, 03 Dec 2003 01:49:10 +0100 Sender: netfilter-devel-admin@lists.netfilter.org Message-ID: <3FCD3306.50603@trash.net> References: <3FCD2AA1.6F5E0225@info-link.net> <3FCD305F.4040406@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Netfilter Development Mailinglist , fabrice@netfilter.org Return-path: To: Brad Fisher In-Reply-To: <3FCD305F.4040406@trash.net> Errors-To: netfilter-devel-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: List-Id: netfilter-devel.vger.kernel.org Patrick McHardy wrote: > POSTROUTING packets don't neccessarily have a timestamp since packets are > stamped when they are received which doesn't happen for locally generated > traffic. In the source I can see an option "kerneltime" which uses > gettimeofday, this should work fine in any chain. The patch does work in > OUTPUT, it uses kerneltime automatically then (and also unneccesarrily > in FORWARD). A correct fix would require using kerneltime in OUTPUT > and POSTROUTING and the skb stamp otherwise. Even better, in POSTROUTING only use the kerneltime when the skb stamp is unset, that way you save expensive gettimeofday calls for forwarded packets. To make it clean, just remove the kerneltime option completely and only look if the stamp is set or unset. > > Best regards, > Patrick > > > > Brad Fisher wrote: > >> I'm curious why the time match doesn't work in POSTROUTING? I have an >> application where it would be helpful to use it as such and was >> wondering if there was a good technical reason why it shouldn't work. >> If I modified the source to allow it to be added to the POSTROUTING >> chain, would it work as expected? I'm assuming it won't be as simple as >> that... >> >> -Brad >> >> >