ia64/xen-unstable

changeset 10040:91c77df11b43

When we copy packet sin netback/netfront make sure the new skb has
all the necessary fields initialised. In particular, before we were
not copying ip_summed and that screws up checksum offload.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed May 10 17:30:42 2006 +0100 (2006-05-10)
parents 36e0159c001b
children e96f98f9c289
files linux-2.6-xen-sparse/drivers/xen/netback/netback.c linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Wed May 10 16:52:55 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Wed May 10 17:30:42 2006 +0100
     1.3 @@ -170,9 +170,10 @@ int netif_be_start_xmit(struct sk_buff *
     1.4  		ret = skb_copy_bits(skb, -hlen, nskb->data - hlen,
     1.5  				     skb->len + hlen);
     1.6  		BUG_ON(ret);
     1.7 +		/* Copy only the header fields we use in this driver. */
     1.8  		nskb->dev = skb->dev;
     1.9 +		nskb->ip_summed = skb->ip_summed;
    1.10  		nskb->proto_data_valid = skb->proto_data_valid;
    1.11 -		nskb->proto_csum_blank = skb->proto_csum_blank;
    1.12  		dev_kfree_skb(skb);
    1.13  		skb = nskb;
    1.14  	}
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Wed May 10 16:52:55 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Wed May 10 17:30:42 2006 +0100
     2.3 @@ -665,7 +665,10 @@ static int network_start_xmit(struct sk_
     2.4  			goto drop;
     2.5  		skb_put(nskb, skb->len);
     2.6  		memcpy(nskb->data, skb->data, skb->len);
     2.7 +		/* Copy only the header fields we use in this driver. */
     2.8  		nskb->dev = skb->dev;
     2.9 +		nskb->ip_summed = skb->ip_summed;
    2.10 +		nskb->proto_data_valid = skb->proto_data_valid;
    2.11  		dev_kfree_skb(skb);
    2.12  		skb = nskb;
    2.13  	}
    2.14 @@ -898,8 +901,11 @@ static int netif_poll(struct net_device 
    2.15  				skb_reserve(nskb, 2);
    2.16  				skb_put(nskb, skb->len);
    2.17  				memcpy(nskb->data, skb->data, skb->len);
    2.18 +				/* Copy any other fields we already set up. */
    2.19  				nskb->dev = skb->dev;
    2.20  				nskb->ip_summed = skb->ip_summed;
    2.21 +				nskb->proto_data_valid = skb->proto_data_valid;
    2.22 +				nskb->proto_csum_blank = skb->proto_csum_blank;
    2.23  			}
    2.24  
    2.25  			/* Reinitialise and then destroy the old skbuff. */