Commit 09972d6f authored by Michal Miroslaw's avatar Michal Miroslaw Committed by David S. Miller

[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: default avatarMichal Miroslaw <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1b53d904
...@@ -590,7 +590,6 @@ nfulnl_log_packet(unsigned int pf, ...@@ -590,7 +590,6 @@ nfulnl_log_packet(unsigned int pf,
struct nfulnl_instance *inst; struct nfulnl_instance *inst;
const struct nf_loginfo *li; const struct nf_loginfo *li;
unsigned int qthreshold; unsigned int qthreshold;
unsigned int nlbufsiz;
unsigned int plen; unsigned int plen;
if (li_user && li_user->type == NF_LOG_TYPE_ULOG) if (li_user && li_user->type == NF_LOG_TYPE_ULOG)
...@@ -666,13 +665,8 @@ nfulnl_log_packet(unsigned int pf, ...@@ -666,13 +665,8 @@ nfulnl_log_packet(unsigned int pf,
return; return;
} }
if (size > inst->nlbufsiz)
nlbufsiz = size;
else
nlbufsiz = inst->nlbufsiz;
if (!inst->skb) { 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", UDEBUG("error in nfulnl_alloc_skb(%u, %u)\n",
inst->nlbufsiz, size); inst->nlbufsiz, size);
goto alloc_failure; goto alloc_failure;
...@@ -688,7 +682,7 @@ nfulnl_log_packet(unsigned int pf, ...@@ -688,7 +682,7 @@ nfulnl_log_packet(unsigned int pf,
instance_put(inst); instance_put(inst);
__nfulnl_send(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", UDEBUG("error in nfulnl_alloc_skb(%u, %u)\n",
inst->nlbufsiz, size); inst->nlbufsiz, size);
goto alloc_failure; goto alloc_failure;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment