From: Al Viro Date: Sat, 22 Dec 2007 18:56:05 +0000 (+0000) Subject: slhc annotations X-Git-Tag: v2.6.25-rc1~1162^2~282 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cd61888d2ab9fa7e08205b18a24885e523df048;p=linux-2.6 slhc annotations Signed-off-by: Al Viro Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/slhc.c b/drivers/net/slhc.c index 0adab709ab..163469739d 100644 --- a/drivers/net/slhc.c +++ b/drivers/net/slhc.c @@ -233,6 +233,7 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize, register unsigned char *cp = new_seq; struct iphdr *ip; struct tcphdr *th, *oth; + __sum16 csum; /* @@ -428,7 +429,7 @@ found: /* Grab the cksum before we overwrite it below. Then update our * state with this packet's header. */ - deltaA = ntohs(th->check); + csum = th->check; memcpy(&cs->cs_ip,ip,20); memcpy(&cs->cs_tcp,th,20); /* We want to use the original packet as our compressed packet. @@ -449,7 +450,8 @@ found: *cpp = ocp; *cp++ = changes; } - cp = put16(cp,(short)deltaA); /* Write TCP checksum */ + *(__sum16 *)cp = csum; + cp += 2; /* deltaS is now the size of the change section of the compressed header */ memcpy(cp,new_seq,deltaS); /* Write list of deltas */ memcpy(cp+deltaS,icp+hlen,isize-hlen); @@ -519,10 +521,8 @@ slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize) thp = &cs->cs_tcp; ip = &cs->cs_ip; - if((x = pull16(&cp)) == -1) { /* Read the TCP checksum */ - goto bad; - } - thp->check = htons(x); + thp->check = *(__sum16 *)cp; + cp += 2; thp->psh = (changes & TCP_PUSH_BIT) ? 1 : 0; /*