Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d63b043d955c261f4f413eecf6e0488d7459acd4
Commit:     d63b043d955c261f4f413eecf6e0488d7459acd4
Parent:     e35670614d10588fb9c6ed32ecd55b8242e98872
Author:     Michal Miroslaw <[EMAIL PROTECTED]>
AuthorDate: Fri Sep 28 14:44:44 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:53:38 2007 -0700

    [NETFILTER]: nfnetlink_log: flush queue early
    
    If queue is filled to its threshold, then flush it right away instead
    of waiting for timer or next packet.
    
    Signed-off-by: Michal Miroslaw <[EMAIL PROTECTED]>
    Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/netfilter/nfnetlink_log.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 512741a..0fa1742 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -644,9 +644,8 @@ nfulnl_log_packet(unsigned int pf,
                goto unlock_and_release;
        }
 
-       if (inst->qlen >= qthreshold ||
-           (inst->skb && size >
-            skb_tailroom(inst->skb) - sizeof(struct nfgenmsg))) {
+       if (inst->skb &&
+           size > skb_tailroom(inst->skb) - sizeof(struct nfgenmsg)) {
                /* either the queue len is too high or we don't have
                 * enough room in the skb left. flush to userspace. */
                UDEBUG("flushing old skb\n");
@@ -666,9 +665,11 @@ nfulnl_log_packet(unsigned int pf,
        __build_packet_message(inst, skb, data_len, pf,
                                hooknum, in, out, li, prefix, plen);
 
+       if (inst->qlen >= qthreshold)
+               __nfulnl_flush(inst);
        /* timer_pending always called within inst->lock, so there
         * is no chance of a race here */
-       if (!timer_pending(&inst->timer)) {
+       else if (!timer_pending(&inst->timer)) {
                instance_get(inst);
                inst->timer.expires = jiffies + (inst->flushtimeout*HZ/100);
                add_timer(&inst->timer);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to