All of lore.kernel.org
 help / color / mirror / Atom feed
* [NETFILTER 1/4]: Fix HW checksum handling in ip_queue/ip6_queue
@ 2005-08-22  0:03 Patrick McHardy
  2005-08-22  6:32 ` David S. Miller
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Patrick McHardy @ 2005-08-22  0:03 UTC (permalink / raw)
  To: David S. Miller; +Cc: Netfilter Development Mailinglist

[-- Attachment #1: Type: text/plain, Size: 354 bytes --]

Hi Dave,

following are a fix for ip_queue and HW checksums, Pablo's string
match and two new targets. Please apply to your net-2.6.14 tree
(the ip_queue fix could also go directly in 2.6.13 IMO).


[NETFILTER]: Fix HW checksum handling in ip_queue/ip6_queue
[NETFILTER]: Add string match
[NETFILTER]: Add IPv6 REJECT target
[NETFILTER]: Add goto target

[-- Attachment #2: 01.diff --]
[-- Type: text/x-patch, Size: 2233 bytes --]

[NETFILTER]: Fix HW checksum handling in ip_queue/ip6_queue

The checksum needs to be filled in on output, after mangling a packet
ip_summed needs to be reset.

Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit 8cf07748b0be017ee9776fa5cb25b7d07e771e37
tree 07e5170035c471f59c866d9df4453a2dad6dd667
parent 01d727422b4153699009a711905e86741f9080e4
author Patrick McHardy <kaber@trash.net> Sun, 21 Aug 2005 21:54:12 +0200
committer Patrick McHardy <kaber@trash.net> Sun, 21 Aug 2005 21:54:12 +0200

 net/ipv4/netfilter/ip_queue.c  |    7 +++++++
 net/ipv6/netfilter/ip6_queue.c |    7 +++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
--- a/net/ipv4/netfilter/ip_queue.c
+++ b/net/ipv4/netfilter/ip_queue.c
@@ -207,6 +207,12 @@ ipq_build_packet_message(struct ipq_queu
 		break;
 	
 	case IPQ_COPY_PACKET:
+		if (entry->skb->ip_summed == CHECKSUM_HW &&
+		    (*errp = skb_checksum_help(entry->skb,
+		                               entry->info->outdev == NULL))) {
+			read_unlock_bh(&queue_lock);
+			return NULL;
+		}
 		if (copy_range == 0 || copy_range > entry->skb->len)
 			data_len = entry->skb->len;
 		else
@@ -371,6 +377,7 @@ ipq_mangle_ipv4(ipq_verdict_msg_t *v, st
 	if (!skb_make_writable(&e->skb, v->data_len))
 		return -ENOMEM;
 	memcpy(e->skb->data, v->payload, v->data_len);
+	e->skb->ip_summed = CHECKSUM_NONE;
 
 	return 0;
 }
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
--- a/net/ipv6/netfilter/ip6_queue.c
+++ b/net/ipv6/netfilter/ip6_queue.c
@@ -205,6 +205,12 @@ ipq_build_packet_message(struct ipq_queu
 		break;
 	
 	case IPQ_COPY_PACKET:
+		if (entry->skb->ip_summed == CHECKSUM_HW &&
+		    (*errp = skb_checksum_help(entry->skb,
+		                               entry->info->outdev == NULL))) {
+			read_unlock_bh(&queue_lock);
+			return NULL;
+		}
 		if (copy_range == 0 || copy_range > entry->skb->len)
 			data_len = entry->skb->len;
 		else
@@ -369,6 +375,7 @@ ipq_mangle_ipv6(ipq_verdict_msg_t *v, st
 	if (!skb_make_writable(&e->skb, v->data_len))
 		return -ENOMEM;
 	memcpy(e->skb->data, v->payload, v->data_len);
+	e->skb->ip_summed = CHECKSUM_NONE;
 
 	return 0;
 }

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

end of thread, other threads:[~2005-08-26 16:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-22  0:03 [NETFILTER 1/4]: Fix HW checksum handling in ip_queue/ip6_queue Patrick McHardy
2005-08-22  6:32 ` David S. Miller
2005-08-23 16:20 ` David S. Miller
2005-08-26 11:11 ` Harald Welte
2005-08-26 16:45   ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.