ia64/xen-unstable

view patches/linux-2.6.14/net-csum.patch @ 8723:61e7afb7344b

The memset in init_switch_stack is overwriting the processor stack.
We need to avoid manipulating the switch stack area of the currently
running cpu. Original patch by Kevin Tian.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Feb 01 00:56:19 2006 +0100 (2006-02-01)
parents 4b06313b9790
children
line source
1 diff -pruN ../pristine-linux-2.6.14/net/ipv4/netfilter/ip_nat_proto_tcp.c ./net/ipv4/netfilter/ip_nat_proto_tcp.c
2 --- ../pristine-linux-2.6.14/net/ipv4/netfilter/ip_nat_proto_tcp.c 2005-10-28 01:02:08.000000000 +0100
3 +++ ./net/ipv4/netfilter/ip_nat_proto_tcp.c 2006-01-31 16:15:46.000000000 +0000
4 @@ -129,10 +129,16 @@ 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,
11 + ip_nat_cheat_check(oldport ^ 0xFFFF,
12 + newport, hdr->check));
13 + } else {
14 + hdr->check = ip_nat_cheat_check(~oldip, newip,
15 ip_nat_cheat_check(oldport ^ 0xFFFF,
16 newport,
17 hdr->check));
18 + }
19 return 1;
20 }
22 diff -pruN ../pristine-linux-2.6.14/net/ipv4/netfilter/ip_nat_proto_udp.c ./net/ipv4/netfilter/ip_nat_proto_udp.c
23 --- ../pristine-linux-2.6.14/net/ipv4/netfilter/ip_nat_proto_udp.c 2005-10-28 01:02:08.000000000 +0100
24 +++ ./net/ipv4/netfilter/ip_nat_proto_udp.c 2006-01-31 16:15:46.000000000 +0000
25 @@ -113,11 +113,19 @@ udp_manip_pkt(struct sk_buff **pskb,
26 newport = tuple->dst.u.udp.port;
27 portptr = &hdr->dest;
28 }
29 - if (hdr->check) /* 0 is a special case meaning no checksum */
30 - hdr->check = ip_nat_cheat_check(~oldip, newip,
31 +
32 + if (hdr->check) { /* 0 is a special case meaning no checksum */
33 + if ((*pskb)->proto_csum_blank) {
34 + hdr->check = ip_nat_cheat_check(oldip, ~newip,
35 + ip_nat_cheat_check(*portptr ^ 0xFFFF,
36 + newport, hdr->check));
37 + } else {
38 + hdr->check = ip_nat_cheat_check(~oldip, newip,
39 ip_nat_cheat_check(*portptr ^ 0xFFFF,
40 newport,
41 hdr->check));
42 + }
43 + }
44 *portptr = newport;
45 return 1;
46 }