mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
64 lines
2.3 KiB
Diff
64 lines
2.3 KiB
Diff
diff -pruN ../pristine-linux-2.6.16.13/net/ipv4/netfilter/ip_nat_proto_tcp.c ./net/ipv4/netfilter/ip_nat_proto_tcp.c
|
|
--- ../pristine-linux-2.6.16.13/net/ipv4/netfilter/ip_nat_proto_tcp.c 2006-05-02 22:38:44.000000000 +0100
|
|
+++ ./net/ipv4/netfilter/ip_nat_proto_tcp.c 2006-05-16 13:28:19.000000000 +0100
|
|
@@ -129,7 +129,12 @@ tcp_manip_pkt(struct sk_buff **pskb,
|
|
if (hdrsize < sizeof(*hdr))
|
|
return 1;
|
|
|
|
- hdr->check = ip_nat_cheat_check(~oldip, newip,
|
|
+#ifdef CONFIG_XEN
|
|
+ if ((*pskb)->proto_csum_blank)
|
|
+ hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
|
|
+ else
|
|
+#endif
|
|
+ hdr->check = ip_nat_cheat_check(~oldip, newip,
|
|
ip_nat_cheat_check(oldport ^ 0xFFFF,
|
|
newport,
|
|
hdr->check));
|
|
diff -pruN ../pristine-linux-2.6.16.13/net/ipv4/netfilter/ip_nat_proto_udp.c ./net/ipv4/netfilter/ip_nat_proto_udp.c
|
|
--- ../pristine-linux-2.6.16.13/net/ipv4/netfilter/ip_nat_proto_udp.c 2006-05-02 22:38:44.000000000 +0100
|
|
+++ ./net/ipv4/netfilter/ip_nat_proto_udp.c 2006-05-16 13:30:14.000000000 +0100
|
|
@@ -113,11 +113,17 @@ udp_manip_pkt(struct sk_buff **pskb,
|
|
newport = tuple->dst.u.udp.port;
|
|
portptr = &hdr->dest;
|
|
}
|
|
- if (hdr->check) /* 0 is a special case meaning no checksum */
|
|
- hdr->check = ip_nat_cheat_check(~oldip, newip,
|
|
+ if (hdr->check) { /* 0 is a special case meaning no checksum */
|
|
+#ifdef CONFIG_XEN
|
|
+ if ((*pskb)->proto_csum_blank)
|
|
+ hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
|
|
+ else
|
|
+#endif
|
|
+ hdr->check = ip_nat_cheat_check(~oldip, newip,
|
|
ip_nat_cheat_check(*portptr ^ 0xFFFF,
|
|
newport,
|
|
hdr->check));
|
|
+ }
|
|
*portptr = newport;
|
|
return 1;
|
|
}
|
|
diff -pruN ../pristine-linux-2.6.16.13/net/ipv4/xfrm4_output.c ./net/ipv4/xfrm4_output.c
|
|
--- ../pristine-linux-2.6.16.13/net/ipv4/xfrm4_output.c 2006-05-02 22:38:44.000000000 +0100
|
|
+++ ./net/ipv4/xfrm4_output.c 2006-05-04 17:41:37.000000000 +0100
|
|
@@ -17,6 +17,8 @@
|
|
#include <net/xfrm.h>
|
|
#include <net/icmp.h>
|
|
|
|
+extern int skb_checksum_setup(struct sk_buff *skb);
|
|
+
|
|
/* Add encapsulation header.
|
|
*
|
|
* In transport mode, the IP header will be moved forward to make space
|
|
@@ -103,6 +105,10 @@ static int xfrm4_output_one(struct sk_bu
|
|
struct xfrm_state *x = dst->xfrm;
|
|
int err;
|
|
|
|
+ err = skb_checksum_setup(skb);
|
|
+ if (err)
|
|
+ goto error_nolock;
|
|
+
|
|
if (skb->ip_summed == CHECKSUM_HW) {
|
|
err = skb_checksum_help(skb, 0);
|
|
if (err)
|