public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
* netfilter: Only do skb_checksum_help on CHECKSUM_PARTIAL in ip_queue
@ 2010-04-08 12:35 Herbert Xu
  2010-04-08 12:39 ` netfilter: Only do skb_checksum_help on CHECKSUM_PARTIAL in ip6_queue Herbert Xu
  2010-04-08 12:53 ` netfilter: Only do skb_checksum_help on CHECKSUM_PARTIAL in ip_queue Patrick McHardy
  0 siblings, 2 replies; 6+ messages in thread
From: Herbert Xu @ 2010-04-08 12:35 UTC (permalink / raw)
  To: Patrick McHardy, David S. Miller, netdev

Hi:

netfilter: Only do skb_checksum_help on CHECKSUM_PARTIAL in ip_queue

While doing yet another audit on ip_summed I noticed ip_queue
calling skb_checksum_help unnecessarily.  As we will set ip_summed
to CHECKSUM_NONE when necessary in ipq_mangle_ipv4, there is no
need to zap CHECKSUM_COMPLETE in ipq_build_packet_message.

Signed-off-by: Herbert Xu <herbert@gondor•apana.org.au>

diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
index e278704..c838238 100644
--- a/net/ipv4/netfilter/ip_queue.c
+++ b/net/ipv4/netfilter/ip_queue.c
@@ -161,8 +161,7 @@ ipq_build_packet_message(struct nf_queue_entry *entry, int *errp)
 		break;
 
 	case IPQ_COPY_PACKET:
-		if ((entry->skb->ip_summed == CHECKSUM_PARTIAL ||
-		     entry->skb->ip_summed == CHECKSUM_COMPLETE) &&
+		if (entry->skb->ip_summed == CHECKSUM_PARTIAL &&
 		    (*errp = skb_checksum_help(entry->skb))) {
 			read_unlock_bh(&queue_lock);
 			return NULL;

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor•apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-04-08 12:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-08 12:35 netfilter: Only do skb_checksum_help on CHECKSUM_PARTIAL in ip_queue Herbert Xu
2010-04-08 12:39 ` netfilter: Only do skb_checksum_help on CHECKSUM_PARTIAL in ip6_queue Herbert Xu
2010-04-08 12:41   ` netfilter: Only do skb_checksum_help on CHECKSUM_PARTIAL in nfnetlink_queue Herbert Xu
2010-04-08 12:55     ` Patrick McHardy
2010-04-08 12:54   ` netfilter: Only do skb_checksum_help on CHECKSUM_PARTIAL in ip6_queue Patrick McHardy
2010-04-08 12:53 ` netfilter: Only do skb_checksum_help on CHECKSUM_PARTIAL in ip_queue Patrick McHardy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox