ia64/xen-unstable

view patches/linux-2.6.16.29/net-csum.patch @ 12273:b223ba940ed1

PV-on-HVM: Fix PV-on-HVM drivers need maddr.h included for defn of maddr_t.
Signed-off-by: Takanori Kasai <Kasai.Takanori@jp.fujitsu.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
author kfraser@localhost.localdomain
date Tue Nov 07 09:29:53 2006 +0000 (2006-11-07)
parents 041be3f6b38e
children
line source
1 diff -pruN ../orig-linux-2.6.16.29/net/ipv4/netfilter/ip_nat_proto_tcp.c ./net/ipv4/netfilter/ip_nat_proto_tcp.c
2 --- ../orig-linux-2.6.16.29/net/ipv4/netfilter/ip_nat_proto_tcp.c 2006-09-12 19:02:10.000000000 +0100
3 +++ ./net/ipv4/netfilter/ip_nat_proto_tcp.c 2006-09-19 13:59:15.000000000 +0100
4 @@ -129,7 +129,12 @@ tcp_manip_pkt(struct sk_buff **pskb,
5 if (hdrsize < sizeof(*hdr))
6 return 1;
8 - hdr->check = ip_nat_cheat_check(~oldip, newip,
9 +#ifdef CONFIG_XEN
10 + if ((*pskb)->proto_csum_blank)
11 + hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
12 + else
13 +#endif
14 + hdr->check = ip_nat_cheat_check(~oldip, newip,
15 ip_nat_cheat_check(oldport ^ 0xFFFF,
16 newport,
17 hdr->check));
18 diff -pruN ../orig-linux-2.6.16.29/net/ipv4/netfilter/ip_nat_proto_udp.c ./net/ipv4/netfilter/ip_nat_proto_udp.c
19 --- ../orig-linux-2.6.16.29/net/ipv4/netfilter/ip_nat_proto_udp.c 2006-09-12 19:02:10.000000000 +0100
20 +++ ./net/ipv4/netfilter/ip_nat_proto_udp.c 2006-09-19 13:59:15.000000000 +0100
21 @@ -113,11 +113,17 @@ udp_manip_pkt(struct sk_buff **pskb,
22 newport = tuple->dst.u.udp.port;
23 portptr = &hdr->dest;
24 }
25 - if (hdr->check) /* 0 is a special case meaning no checksum */
26 - hdr->check = ip_nat_cheat_check(~oldip, newip,
27 + if (hdr->check) { /* 0 is a special case meaning no checksum */
28 +#ifdef CONFIG_XEN
29 + if ((*pskb)->proto_csum_blank)
30 + hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
31 + else
32 +#endif
33 + hdr->check = ip_nat_cheat_check(~oldip, newip,
34 ip_nat_cheat_check(*portptr ^ 0xFFFF,
35 newport,
36 hdr->check));
37 + }
38 *portptr = newport;
39 return 1;
40 }
41 diff -pruN ../orig-linux-2.6.16.29/net/ipv4/xfrm4_output.c ./net/ipv4/xfrm4_output.c
42 --- ../orig-linux-2.6.16.29/net/ipv4/xfrm4_output.c 2006-09-12 19:02:10.000000000 +0100
43 +++ ./net/ipv4/xfrm4_output.c 2006-09-19 13:59:15.000000000 +0100
44 @@ -17,6 +17,8 @@
45 #include <net/xfrm.h>
46 #include <net/icmp.h>
48 +extern int skb_checksum_setup(struct sk_buff *skb);
49 +
50 /* Add encapsulation header.
51 *
52 * In transport mode, the IP header will be moved forward to make space
53 @@ -103,6 +105,10 @@ static int xfrm4_output_one(struct sk_bu
54 struct xfrm_state *x = dst->xfrm;
55 int err;
57 + err = skb_checksum_setup(skb);
58 + if (err)
59 + goto error_nolock;
60 +
61 if (skb->ip_summed == CHECKSUM_HW) {
62 err = skb_checksum_help(skb, 0);
63 if (err)