Patchwork netfilter: Only do skb_checksum_help on CHECKSUM_PARTIAL in nfnetlink_queue

login
register
mail settings
Submitter Herbert Xu
Date April 8, 2010, 12:41 p.m.
Message ID <20100408124158.GB23910@gondor.apana.org.au>
Download mbox | patch
Permalink /patch/49730/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Herbert Xu - April 8, 2010, 12:41 p.m.
netfilter: Only do skb_checksum_help on CHECKSUM_PARTIAL in nfnetlink_queue

As we will set ip_summed to CHECKSUM_NONE when necessary in
nfqnl_mangle, there is no need to zap CHECKSUM_COMPLETE in
nfqnl_build_packet_message.

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


Cheers,
Patrick McHardy - April 8, 2010, 12:55 p.m.
Herbert Xu wrote:
> netfilter: Only do skb_checksum_help on CHECKSUM_PARTIAL in nfnetlink_queue
> 
> As we will set ip_summed to CHECKSUM_NONE when necessary in
> nfqnl_mangle, there is no need to zap CHECKSUM_COMPLETE in
> nfqnl_build_packet_message.

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index e70a6ef..12e1ab3 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -246,8 +246,7 @@  nfqnl_build_packet_message(struct nfqnl_instance *queue,
 		break;
 
 	case NFQNL_COPY_PACKET:
-		if ((entskb->ip_summed == CHECKSUM_PARTIAL ||
-		     entskb->ip_summed == CHECKSUM_COMPLETE) &&
+		if (entskb->ip_summed == CHECKSUM_PARTIAL &&
 		    skb_checksum_help(entskb)) {
 			spin_unlock_bh(&queue->lock);
 			return NULL;