Skip to contentSkip to conversation

nfnetlink_log: don't count max(a,b) twice

PATCH Applied Michał Mirosław 2 participants 2 messages Feb 12, 2007 – Feb 13, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/10 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.

net/netfilter/nfnetlink_log.c renamed from net/netfilter/nfnetlink_log.c.orig +2 -8
@@ -596,7 +596,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) 
@@ -672,13 +671,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;
@@ -691,7 +685,7 @@ nfulnl_log_packet(unsigned int pf,
 
 		__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;
#1 lore raw
Quoted 2 lines · Micha³ Miros³aw

We don't need local nlbufsiz (skb size) as nfulnl_alloc_skb() takes the maximum anyway.

Applied, thanks.