aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Miroslaw <mirq-linux@rere.qmqm.pl>2007-03-23 14:10:47 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:27:36 -0400
commit09972d6f968d67dd82cbd403d5aa42c241a8d0cb (patch)
tree135312dfd2fbe3494cf3df391024451266d8781b
parent1b53d9042c04b8eb875d02e65792e9884efc3784 (diff)
[NETFILTER]: nfnetlink_log: don't count max(a,b) twice
We don't need local nlbufsiz (skb size) as nfulnl_alloc_skb() takes the maximum anyway. Signed-off-by: Michal Miroslaw <mirq-linux@rere.qmqm.pl> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/netfilter/nfnetlink_log.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 8ae83cb9a39c..3b849a72d7c9 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -590,7 +590,6 @@ nfulnl_log_packet(unsigned int pf,
590 struct nfulnl_instance *inst; 590 struct nfulnl_instance *inst;
591 const struct nf_loginfo *li; 591 const struct nf_loginfo *li;
592 unsigned int qthreshold; 592 unsigned int qthreshold;
593 unsigned int nlbufsiz;
594 unsigned int plen; 593 unsigned int plen;
595 594
596 if (li_user && li_user->type == NF_LOG_TYPE_ULOG) 595 if (li_user && li_user->type == NF_LOG_TYPE_ULOG)
@@ -666,13 +665,8 @@ nfulnl_log_packet(unsigned int pf,
666 return; 665 return;
667 } 666 }
668 667
669 if (size > inst->nlbufsiz)
670 nlbufsiz = size;
671 else
672 nlbufsiz = inst->nlbufsiz;
673
674 if (!inst->skb) { 668 if (!inst->skb) {
675 if (!(inst->skb = nfulnl_alloc_skb(nlbufsiz, size))) { 669 if (!(inst->skb = nfulnl_alloc_skb(inst->nlbufsiz, size))) {
676 UDEBUG("error in nfulnl_alloc_skb(%u, %u)\n", 670 UDEBUG("error in nfulnl_alloc_skb(%u, %u)\n",
677 inst->nlbufsiz, size); 671 inst->nlbufsiz, size);
678 goto alloc_failure; 672 goto alloc_failure;
@@ -688,7 +682,7 @@ nfulnl_log_packet(unsigned int pf,
688 instance_put(inst); 682 instance_put(inst);
689 __nfulnl_send(inst); 683 __nfulnl_send(inst);
690 684
691 if (!(inst->skb = nfulnl_alloc_skb(nlbufsiz, size))) { 685 if (!(inst->skb = nfulnl_alloc_skb(inst->nlbufsiz, size))) {
692 UDEBUG("error in nfulnl_alloc_skb(%u, %u)\n", 686 UDEBUG("error in nfulnl_alloc_skb(%u, %u)\n",
693 inst->nlbufsiz, size); 687 inst->nlbufsiz, size);
694 goto alloc_failure; 688 goto alloc_failure;