NETFILTER: ipt_ULOG fix for last packet delay
Subsystems (2)
PATCH 1/1 NETFILTER: ipt_ULOG fix for last packet delay
Hi Dave!
This 2.4-patch was the only bugfix in my recent 2.6.x patch series.
At this point I don't think it's worth to further sync netfilter for 2.4.x and 2.6.x anymore, apart from bufixes, of course.
The ULOG target used to delay the last packet until another one was received. This patch fixes the issue.
Please apply,
Thanks.
Signed-off-by Ruby Joker <[email protected]>
Signed-off-by Harald Welte <[email protected]>
net/ipv4/netfilter/ipt_ULOG.c +9 -9
@@ -97,7 +97,6 @@static ulog_buff_t ulog_buffers[ULOG_MAXNLGROUPS ];/* array of buffers */ static struct sock *nflognl;/* our socket */ -static size_t qlen;/* current length of multipart-nlmsg */ DECLARE_LOCK (ulog_lock);/* spinlock */ /* send one ulog_buff_t to userspace */
@@ -116,7 +115,7 @@NETLINK_CB (ub->skb).dst_groups = (1 << nlgroupnum);DEBUGP ("ipt_ULOG: throwing %d packets to netlink mask %u\n" , - ub->qlen, nlgroup); + ub->qlen, nlgroupnum);netlink_broadcast (nflognl, ub->skb,0 , (1 << nlgroupnum),GFP_ATOMIC ); ub->qlen =0 ;
@@ -126,7 +125,7 @@ } -/* timer function to flush queue in ULOG_FLUSH_INTERVAL time */ +/* timer function to flush queue in flushtimeout time */ static void ulog_timer (unsigned long data) {DEBUGP ("ipt_ULOG: timer function called, calling ulog_send\n" );
@@ -257,12 +256,6 @@ ub->lastnlh->nlmsg_flags |=NLM_F_MULTI ; } -/* if threshold is reached, send message to userspace */ -if (qlen >= loginfo->qthreshold) { -if (loginfo->qthreshold >1 ) - nlh->nlmsg_type =NLMSG_DONE ; - } - ub->lastnlh = nlh;/* if timer isn't already running, start it */
@@ -271,6 +264,13 @@add_timer (&ub->timer); } +/* if threshold is reached, send message to userspace */ +if (ub->qlen >= loginfo->qthreshold) { +if (loginfo->qthreshold >1 ) + nlh->nlmsg_type =NLMSG_DONE ; +ulog_send (groupnum); + } +UNLOCK_BH (&ulog_lock);return ;
Signature · 5 lines
- Harald Welte <[email protected]> http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie
David S. Miller
AppliedQuoted 2 lines · On Sun, 1 Aug 2004 23:27:05 +0200 Harald Welte <[email protected]> wrote:
The ULOG target used to delay the last packet until another one was received. This patch fixes the issue.
Applied.