From: Patrick McHardy Date: Tue, 6 Sep 2005 22:10:00 +0000 (-0700) Subject: [NETFILTER]: Fix HW checksum handling in nfnetlink_queue X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=e7dfb09a3624a32df2dd00683875d0e56406a603;p=openwrt%2Fstaging%2Fblogic.git [NETFILTER]: Fix HW checksum handling in nfnetlink_queue Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index 249bddb28acd..f81fe8c52e99 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c @@ -371,6 +371,12 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue, break; case NFQNL_COPY_PACKET: + if (entry->skb->ip_summed == CHECKSUM_HW && + (*errp = skb_checksum_help(entry->skb, + entry->info->outdev == NULL))) { + spin_unlock_bh(&queue->lock); + return NULL; + } if (queue->copy_range == 0 || queue->copy_range > entry->skb->len) data_len = entry->skb->len; @@ -636,7 +642,7 @@ nfqnl_mangle(void *data, int data_len, struct nfqnl_queue_entry *e) if (!skb_make_writable(&e->skb, data_len)) return -ENOMEM; memcpy(e->skb->data, data, data_len); - + e->skb->ip_summed = CHECKSUM_NONE; return 0; }