[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [linux-2.6.18-xen] Imported patch net-csum.patch from xen-unstable.hg 15200:bd3d6b4c52ec
# HG changeset patch # User Ian Campbell <ian.campbell@xxxxxxxxxxxxx> # Date 1180947923 -3600 # Node ID fac1f3836a60c612a64efdadb4702f71133533b1 # Parent aa96379da7411fbe1cdb33e2eef842a0a37348d2 Imported patch net-csum.patch from xen-unstable.hg 15200:bd3d6b4c52ec --- net/ipv4/netfilter/ip_nat_proto_tcp.c | 7 ++++++- net/ipv4/netfilter/ip_nat_proto_udp.c | 10 ++++++++-- net/ipv4/xfrm4_output.c | 6 ++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff -r aa96379da741 -r fac1f3836a60 net/ipv4/netfilter/ip_nat_proto_tcp.c --- a/net/ipv4/netfilter/ip_nat_proto_tcp.c Mon Jun 04 10:05:23 2007 +0100 +++ b/net/ipv4/netfilter/ip_nat_proto_tcp.c Mon Jun 04 10:05:23 2007 +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 -r aa96379da741 -r fac1f3836a60 net/ipv4/netfilter/ip_nat_proto_udp.c --- a/net/ipv4/netfilter/ip_nat_proto_udp.c Mon Jun 04 10:05:23 2007 +0100 +++ b/net/ipv4/netfilter/ip_nat_proto_udp.c Mon Jun 04 10:05:23 2007 +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 -r aa96379da741 -r fac1f3836a60 net/ipv4/xfrm4_output.c --- a/net/ipv4/xfrm4_output.c Mon Jun 04 10:05:23 2007 +0100 +++ b/net/ipv4/xfrm4_output.c Mon Jun 04 10:05:23 2007 +0100 @@ -17,6 +17,8 @@ #include <net/ip.h> #include <net/xfrm.h> #include <net/icmp.h> + +extern int skb_checksum_setup(struct sk_buff *skb); static int xfrm4_tunnel_check_size(struct sk_buff *skb) { @@ -48,6 +50,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) _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |