From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: netfilter-devel@lists.netfilter.org, Patrick McHardy <kaber@trash.net>
Subject: [NETFILTER 02/12]: nfnetlink_log: don't count max(a,b) twice
Date: Fri, 23 Mar 2007 15:05:01 +0100 (MET) [thread overview]
Message-ID: <20070323140436.22987.20165.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20070323140433.22987.44867.sendpatchset@localhost.localdomain>
[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>
---
commit 9bff4aef16228a63f2fd5515dcec087574019a75
tree 9c9b3d253ee3a49a401d24b3befe69ce941ab43c
parent 7d6eb2567f5694088bda13109f45b6b16ef1e21d
author Michal Miroslaw <mirq-linux@rere.qmqm.pl> Thu, 22 Mar 2007 23:01:00 +0100
committer Patrick McHardy <kaber@trash.net> Fri, 23 Mar 2007 11:00:20 +0100
net/netfilter/nfnetlink_log.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 8ae83cb..3b849a7 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -590,7 +590,6 @@ nfulnl_log_packet(unsigned int pf,
struct nfulnl_instance *inst;
const struct nf_loginfo *li;
unsigned int qthreshold;
- unsigned int nlbufsiz;
unsigned int plen;
if (li_user && li_user->type == NF_LOG_TYPE_ULOG)
@@ -666,13 +665,8 @@ nfulnl_log_packet(unsigned int pf,
return;
}
- if (size > inst->nlbufsiz)
- nlbufsiz = size;
- else
- nlbufsiz = inst->nlbufsiz;
-
if (!inst->skb) {
- if (!(inst->skb = nfulnl_alloc_skb(nlbufsiz, size))) {
+ if (!(inst->skb = nfulnl_alloc_skb(inst->nlbufsiz, size))) {
UDEBUG("error in nfulnl_alloc_skb(%u, %u)\n",
inst->nlbufsiz, size);
goto alloc_failure;
@@ -688,7 +682,7 @@ nfulnl_log_packet(unsigned int pf,
instance_put(inst);
__nfulnl_send(inst);
- if (!(inst->skb = nfulnl_alloc_skb(nlbufsiz, size))) {
+ if (!(inst->skb = nfulnl_alloc_skb(inst->nlbufsiz, size))) {
UDEBUG("error in nfulnl_alloc_skb(%u, %u)\n",
inst->nlbufsiz, size);
goto alloc_failure;
next prev parent reply other threads:[~2007-03-23 14:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-23 14:04 [NETFILTER 00/12]: Netfilter update part II Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 01/12]: Remove changelogs and CVS IDs Patrick McHardy
2007-03-23 14:05 ` Patrick McHardy [this message]
2007-03-23 14:05 ` [NETFILTER 03/12]: nfnetlink_log: kill duplicate code Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 04/12]: nfnetlink_log: micro-optimization for inst==NULL in nfulnl_recv_config() Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 05/12]: nfnetlink_log: micro-optimization: don't modify destroyed instance Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 06/12]: nfnetlink_log: iterator functions need iter_state * only Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 07/12]: nfnetlink_log: micro-optimization: inst->skb != NULL in __nfulnl_send() Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 08/12]: nfnetlink_log: remove conditional locking Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 09/12]: Use setup_timer Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 10/12]: nf_conntrack: don't use nfct in skb if conntrack is disabled Patrick McHardy
2007-03-23 14:05 ` [NETFILTER 11/12]: nf_conntrack: kill destroy() in struct nf_conntrack for diet Patrick McHardy
2007-03-23 14:05 ` [NETFILTER] nfnetlink: netlink_run_queue() already checks for NLM_F_REQUEST Patrick McHardy
2007-03-23 18:24 ` [NETFILTER 00/12]: Netfilter update part II David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070323140436.22987.20165.sendpatchset@localhost.localdomain \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.