source: trunk/packages/xen-3.1/xen-3.1/patches/linux-2.6.18/net-csum.patch @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

  • Property svn:mime-type set to text/x-patch
File size: 2.3 KB
  • net/ipv4/netfilter/ip_nat_proto_tcp.c

    diff -pruN ../orig-linux-2.6.18/net/ipv4/netfilter/ip_nat_proto_tcp.c ./net/ipv4/netfilter/ip_nat_proto_tcp.c
    old new tcp_manip_pkt(struct sk_buff **pskb, 
    129129        if (hdrsize < sizeof(*hdr))
    130130                return 1;
    131131
    132         hdr->check = ip_nat_cheat_check(~oldip, newip,
     132#ifdef CONFIG_XEN
     133        if ((*pskb)->proto_csum_blank)
     134                hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
     135        else
     136#endif
     137                hdr->check = ip_nat_cheat_check(~oldip, newip,
    133138                                        ip_nat_cheat_check(oldport ^ 0xFFFF,
    134139                                                           newport,
    135140                                                           hdr->check));
  • net/ipv4/netfilter/ip_nat_proto_udp.c

    diff -pruN ../orig-linux-2.6.18/net/ipv4/netfilter/ip_nat_proto_udp.c ./net/ipv4/netfilter/ip_nat_proto_udp.c
    old new udp_manip_pkt(struct sk_buff **pskb, 
    113113                newport = tuple->dst.u.udp.port;
    114114                portptr = &hdr->dest;
    115115        }
    116         if (hdr->check) /* 0 is a special case meaning no checksum */
    117                 hdr->check = ip_nat_cheat_check(~oldip, newip,
     116        if (hdr->check) { /* 0 is a special case meaning no checksum */
     117#ifdef CONFIG_XEN
     118                if ((*pskb)->proto_csum_blank)
     119                        hdr->check = ip_nat_cheat_check(oldip, ~newip, hdr->check);
     120                else
     121#endif
     122                        hdr->check = ip_nat_cheat_check(~oldip, newip,
    118123                                        ip_nat_cheat_check(*portptr ^ 0xFFFF,
    119124                                                           newport,
    120125                                                           hdr->check));
     126        }
    121127        *portptr = newport;
    122128        return 1;
    123129}
  • net/ipv4/xfrm4_output.c

    diff -pruN ../orig-linux-2.6.18/net/ipv4/xfrm4_output.c ./net/ipv4/xfrm4_output.c
    old new  
    1818#include <net/xfrm.h>
    1919#include <net/icmp.h>
    2020
     21extern int skb_checksum_setup(struct sk_buff *skb);
     22
    2123static int xfrm4_tunnel_check_size(struct sk_buff *skb)
    2224{
    2325        int mtu, ret = 0;
    static int xfrm4_output_one(struct sk_bu 
    4850        struct xfrm_state *x = dst->xfrm;
    4951        int err;
    5052       
     53        err = skb_checksum_setup(skb);
     54        if (err)
     55                goto error_nolock;
     56
    5157        if (skb->ip_summed == CHECKSUM_HW) {
    5258                err = skb_checksum_help(skb, 0);
    5359                if (err)
Note: See TracBrowser for help on using the repository browser.