ia64/xen-unstable

view patches/linux-2.6.16.13/net-csum.patch @ 10170:2436cc71de50

Remove unnecessary x86-specific mapping code from privcmd interface.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed May 24 14:49:24 2006 +0100 (2006-05-24)
parents ad5b833122a8
children cebedeefbfbd
line source
1 diff -pruN ../pristine-linux-2.6.16.13/net/ipv4/netfilter/ip_nat_proto_tcp.c ./net/ipv4/netfilter/ip_nat_proto_tcp.c
2 --- ../pristine-linux-2.6.16.13/net/ipv4/netfilter/ip_nat_proto_tcp.c 2006-05-02 22:38:44.000000000 +0100
3 +++ ./net/ipv4/netfilter/ip_nat_proto_tcp.c 2006-05-04 17:41:37.000000000 +0100
4 @@ -129,10 +129,14 @@ 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 + if ((*pskb)->proto_csum_blank) {
10 + hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
11 + } else {
12 + hdr->check = ip_nat_cheat_check(~oldip, newip,
13 ip_nat_cheat_check(oldport ^ 0xFFFF,
14 newport,
15 hdr->check));
16 + }
17 return 1;
18 }
20 diff -pruN ../pristine-linux-2.6.16.13/net/ipv4/netfilter/ip_nat_proto_udp.c ./net/ipv4/netfilter/ip_nat_proto_udp.c
21 --- ../pristine-linux-2.6.16.13/net/ipv4/netfilter/ip_nat_proto_udp.c 2006-05-02 22:38:44.000000000 +0100
22 +++ ./net/ipv4/netfilter/ip_nat_proto_udp.c 2006-05-04 17:41:37.000000000 +0100
23 @@ -113,11 +113,16 @@ udp_manip_pkt(struct sk_buff **pskb,
24 newport = tuple->dst.u.udp.port;
25 portptr = &hdr->dest;
26 }
27 - if (hdr->check) /* 0 is a special case meaning no checksum */
28 - hdr->check = ip_nat_cheat_check(~oldip, newip,
29 + if (hdr->check) { /* 0 is a special case meaning no checksum */
30 + if ((*pskb)->proto_csum_blank) {
31 + hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
32 + } else {
33 + hdr->check = ip_nat_cheat_check(~oldip, newip,
34 ip_nat_cheat_check(*portptr ^ 0xFFFF,
35 newport,
36 hdr->check));
37 + }
38 + }
39 *portptr = newport;
40 return 1;
41 }
42 diff -pruN ../pristine-linux-2.6.16.13/net/ipv4/xfrm4_output.c ./net/ipv4/xfrm4_output.c
43 --- ../pristine-linux-2.6.16.13/net/ipv4/xfrm4_output.c 2006-05-02 22:38:44.000000000 +0100
44 +++ ./net/ipv4/xfrm4_output.c 2006-05-04 17:41:37.000000000 +0100
45 @@ -17,6 +17,8 @@
46 #include <net/xfrm.h>
47 #include <net/icmp.h>
49 +extern int skb_checksum_setup(struct sk_buff *skb);
50 +
51 /* Add encapsulation header.
52 *
53 * In transport mode, the IP header will be moved forward to make space
54 @@ -103,6 +105,10 @@ static int xfrm4_output_one(struct sk_bu
55 struct xfrm_state *x = dst->xfrm;
56 int err;
58 + err = skb_checksum_setup(skb);
59 + if (err)
60 + goto error_nolock;
61 +
62 if (skb->ip_summed == CHECKSUM_HW) {
63 err = skb_checksum_help(skb, 0);
64 if (err)