Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=55b5a91e1723280570957990a0c5ab8c3ec4090a
Commit:     55b5a91e1723280570957990a0c5ab8c3ec4090a
Parent:     09972d6f968d67dd82cbd403d5aa42c241a8d0cb
Author:     Michal Miroslaw <[EMAIL PROTECTED]>
AuthorDate: Fri Mar 23 11:11:05 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:27:37 2007 -0700

    [NETFILTER]: nfnetlink_log: kill duplicate code
    
    Kill some duplicate code in nfulnl_log_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 |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 3b849a7..d14cf51 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -660,19 +660,11 @@ nfulnl_log_packet(unsigned int pf,
                break;
 
        default:
-               spin_unlock_bh(&inst->lock);
-               instance_put(inst);
-               return;
+               goto unlock_and_release;
        }
 
-       if (!inst->skb) {
-               if (!(inst->skb = nfulnl_alloc_skb(inst->nlbufsiz, size))) {
-                       UDEBUG("error in nfulnl_alloc_skb(%u, %u)\n",
-                               inst->nlbufsiz, size);
-                       goto alloc_failure;
-               }
-       } else if (inst->qlen >= qthreshold ||
-                  size > skb_tailroom(inst->skb)) {
+       if (inst->qlen >= qthreshold ||
+           (inst->skb && size > skb_tailroom(inst->skb))) {
                /* 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");
@@ -681,12 +673,12 @@ nfulnl_log_packet(unsigned int pf,
                if (del_timer(&inst->timer))
                        instance_put(inst);
                __nfulnl_send(inst);
+       }
 
-               if (!(inst->skb = nfulnl_alloc_skb(inst->nlbufsiz, size))) {
-                       UDEBUG("error in nfulnl_alloc_skb(%u, %u)\n",
-                               inst->nlbufsiz, size);
+       if (!inst->skb) {
+               inst->skb = nfulnl_alloc_skb(inst->nlbufsiz, size);
+               if (!inst->skb)
                        goto alloc_failure;
-               }
        }
 
        UDEBUG("qlen %d, qthreshold %d\n", inst->qlen, qthreshold);
-
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