ia64/xen-unstable

changeset 720:017595b44310

bitkeeper revision 1.426 (3f67735ai0MOd0z8ockI7RQVT4dA_Q)

fix broken checksum calculation code for UDP console.
author iap10@labyrinth.cl.cam.ac.uk
date Tue Sep 16 20:32:26 2003 +0000 (2003-09-16)
parents 0b04d8a47390
children 2c22db3e819b
files tools/misc/xen-clone xen/common/kernel.c
line diff
     1.1 --- a/tools/misc/xen-clone	Thu Sep 11 12:38:25 2003 +0000
     1.2 +++ b/tools/misc/xen-clone	Tue Sep 16 20:32:26 2003 +0000
     1.3 @@ -39,8 +39,8 @@ UCCL)
     1.4  	PATH=$PATH:/usr/groups/xeno/build_tools/bin
     1.5  	mkdir -p install/boot
     1.6  	cd install/boot
     1.7 -	ln -sf ../../xeno-roots/roots .
     1.8 -	ln -sf ../../xeno-roots/usr .
     1.9 +	ln -sf ../../../xeno-roots/roots .
    1.10 +	ln -sf ../../../xeno-roots/usr .
    1.11  	ln -sf ../lib .
    1.12  	ln -sf ../bin .
    1.13  	ln -sf /usr/groups/srgboot/${USER}/xenoboot.sh .
     2.1 --- a/xen/common/kernel.c	Thu Sep 11 12:38:25 2003 +0000
     2.2 +++ b/xen/common/kernel.c	Tue Sep 16 20:32:26 2003 +0000
     2.3 @@ -461,9 +461,9 @@ unsigned short compute_cksum(unsigned sh
     2.4      unsigned long sum = 0;
     2.5      while ( count-- )
     2.6          sum += *buf++;
     2.7 -    sum += sum >> 16;
     2.8 -    sum += sum >> 16;
     2.9 -    return (unsigned short)~sum;
    2.10 +    while ( sum >> 16 )
    2.11 +	sum = (sum & 0xffff) + (sum >> 16);
    2.12 +    return (unsigned short) ~sum;
    2.13  }
    2.14  
    2.15  
    2.16 @@ -495,18 +495,19 @@ int console_export(char *str, int len)
    2.17      udph = (struct udphdr *)(iph + 1); 
    2.18  
    2.19      skb_reserve(skb, sizeof(struct ethhdr)); 
    2.20 -    skb_put(skb, hdr_size + len); 
    2.21 +    skb_put(skb, hdr_size +  len); 
    2.22  
    2.23      /* Build IP header. */
    2.24      iph->version = 4;
    2.25      iph->ihl     = 5;
    2.26 +    iph->tos	 = 0;
    2.27 +    iph->tot_len = htons(hdr_size + len);
    2.28 +    iph->id      = 0xdead;
    2.29      iph->frag_off= 0;
    2.30 -    iph->id      = 0xdead;
    2.31      iph->ttl     = 255;
    2.32      iph->protocol= 17;
    2.33      iph->daddr   = htonl(0xa9fe0100);  /* 169.254.1.0 */
    2.34      iph->saddr   = htonl(0xa9fefeff);  /* 169.254.254.255 */
    2.35 -    iph->tot_len = htons(hdr_size + len); 
    2.36      iph->check	 = 0;
    2.37      iph->check   = compute_cksum((__u16 *)iph, sizeof(struct iphdr)/2); 
    2.38