ia64/xen-unstable

view patches/linux-2.6.12/net-csum.patch @ 7588:cf0c13832905

Make check_pkgs work with the Bourne shell
author kaf24@firebug.cl.cam.ac.uk
date Mon Oct 31 17:11:24 2005 +0100 (2005-10-31)
parents 26862e5458eb
children
line source
1 diff -ur linux-2.6.11/net/ipv4/netfilter/ip_conntrack_proto_udp.c linux-2.6.11-csum/net/ipv4/netfilter/ip_conntrack_proto_udp.c
2 --- linux-2.6.11/net/ipv4/netfilter/ip_conntrack_proto_udp.c 2005-05-27 11:47:48 +01:00
3 +++ linux-2.6.11-csum/net/ipv4/netfilter/ip_conntrack_proto_udp.c 2005-05-27 11:48:07 +01:00
4 @@ -120,6 +120,7 @@
5 * and moreover root might send raw packets.
6 * FIXME: Source route IP option packets --RR */
7 if (hooknum == NF_IP_PRE_ROUTING
8 + && skb->ip_summed != CHECKSUM_UNNECESSARY
9 && csum_tcpudp_magic(iph->saddr, iph->daddr, udplen, IPPROTO_UDP,
10 skb->ip_summed == CHECKSUM_HW ? skb->csum
11 : skb_checksum(skb, iph->ihl*4, udplen, 0))) {
13 --- ../xen-unstable.hg/linux-2.6.12-xen0/net/ipv4/netfilter/ip_nat_proto_udp.c 2005-06-17 14:48:29.000000000 -0500
14 +++ linux-2.6-xen-sparse/net/ipv4/netfilter/ip_nat_proto_udp.c 2005-10-14 15:17:53.000000000 -0500
15 @@ -112,11 +112,19 @@ udp_manip_pkt(struct sk_buff **pskb,
16 newport = tuple->dst.u.udp.port;
17 portptr = &hdr->dest;
18 }
19 - if (hdr->check) /* 0 is a special case meaning no checksum */
20 - hdr->check = ip_nat_cheat_check(~oldip, newip,
21 +
22 + if (hdr->check) { /* 0 is a special case meaning no checksum */
23 + if ((*pskb)->proto_csum_blank) {
24 + hdr->check = ip_nat_cheat_check(oldip, ~newip,
25 + ip_nat_cheat_check(*portptr ^ 0xFFFF,
26 + newport, hdr->check));
27 + } else {
28 + hdr->check = ip_nat_cheat_check(~oldip, newip,
29 ip_nat_cheat_check(*portptr ^ 0xFFFF,
30 newport,
31 hdr->check));
32 + }
33 + }
34 *portptr = newport;
35 return 1;
36 }
37 --- ../xen-unstable.hg/linux-2.6.12-xen0/net/ipv4/netfilter/ip_nat_proto_tcp.c 2005-06-17 14:48:29.000000000 -0500
38 +++ linux-2.6-xen-sparse/net/ipv4/netfilter/ip_nat_proto_tcp.c 2005-10-14 16:41:20.000000000 -0500
39 @@ -127,10 +127,16 @@ tcp_manip_pkt(struct sk_buff **pskb,
40 if (hdrsize < sizeof(*hdr))
41 return 1;
43 - hdr->check = ip_nat_cheat_check(~oldip, newip,
44 + if ((*pskb)->proto_csum_blank) {
45 + hdr->check = ip_nat_cheat_check(oldip, ~newip,
46 + ip_nat_cheat_check(oldport ^ 0xFFFF,
47 + newport, hdr->check));
48 + } else {
49 + hdr->check = ip_nat_cheat_check(~oldip, newip,
50 ip_nat_cheat_check(oldport ^ 0xFFFF,
51 newport,
52 hdr->check));
53 + }
54 return 1;
55 }