ia64/xen-unstable

changeset 11196:cbdc98fc3a6f

[NET] front: Allow driver to be built against kernels which do not
have extended checksum-offload info fields in teh skbuff structure.
Based on a patch from Steven Smith <ssmith@xensource.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Aug 17 17:08:19 2006 +0100 (2006-08-17)
parents 8d5e6a78d51e
children 3127d6744dd1
files linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Thu Aug 17 16:57:43 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Thu Aug 17 17:08:19 2006 +0100
     1.3 @@ -900,8 +900,10 @@ static int network_start_xmit(struct sk_
     1.4  
     1.5  	if (skb->ip_summed == CHECKSUM_HW) /* local packet? */
     1.6  		tx->flags |= NETTXF_csum_blank | NETTXF_data_validated;
     1.7 +#ifdef CONFIG_XEN
     1.8  	if (skb->proto_data_valid) /* remote but checksummed? */
     1.9  		tx->flags |= NETTXF_data_validated;
    1.10 +#endif
    1.11  
    1.12  #ifdef HAVE_GSO
    1.13  	if (skb_shinfo(skb)->gso_size) {
    1.14 @@ -1312,15 +1314,14 @@ err:
    1.15  		 * Old backends do not assert data_validated but we
    1.16  		 * can infer it from csum_blank so test both flags.
    1.17  		 */
    1.18 -		if (rx->flags & (NETRXF_data_validated|NETRXF_csum_blank)) {
    1.19 +		if (rx->flags & (NETRXF_data_validated|NETRXF_csum_blank))
    1.20  			skb->ip_summed = CHECKSUM_UNNECESSARY;
    1.21 -			skb->proto_data_valid = 1;
    1.22 -		} else {
    1.23 +		else
    1.24  			skb->ip_summed = CHECKSUM_NONE;
    1.25 -			skb->proto_data_valid = 0;
    1.26 -		}
    1.27 +#ifdef CONFIG_XEN
    1.28 +		skb->proto_data_valid = (skb->ip_summed != CHECKSUM_NONE);
    1.29  		skb->proto_csum_blank = !!(rx->flags & NETRXF_csum_blank);
    1.30 -
    1.31 +#endif
    1.32  		np->stats.rx_packets++;
    1.33  		np->stats.rx_bytes += skb->len;
    1.34