aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2007-12-22 13:56:05 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:07:59 -0500
commit7cd61888d2ab9fa7e08205b18a24885e523df048 (patch)
tree604f9b22de7394c83c98184ac4c35b11fbc6b43d /drivers/net
parent3dd5f1d422d8a736178a760562c98d4169b33a23 (diff)
slhc annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/slhc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/slhc.c b/drivers/net/slhc.c
index 0adab709ab6..163469739db 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,
233 register unsigned char *cp = new_seq; 233 register unsigned char *cp = new_seq;
234 struct iphdr *ip; 234 struct iphdr *ip;
235 struct tcphdr *th, *oth; 235 struct tcphdr *th, *oth;
236 __sum16 csum;
236 237
237 238
238 /* 239 /*
@@ -428,7 +429,7 @@ found:
428 /* Grab the cksum before we overwrite it below. Then update our 429 /* Grab the cksum before we overwrite it below. Then update our
429 * state with this packet's header. 430 * state with this packet's header.
430 */ 431 */
431 deltaA = ntohs(th->check); 432 csum = th->check;
432 memcpy(&cs->cs_ip,ip,20); 433 memcpy(&cs->cs_ip,ip,20);
433 memcpy(&cs->cs_tcp,th,20); 434 memcpy(&cs->cs_tcp,th,20);
434 /* We want to use the original packet as our compressed packet. 435 /* We want to use the original packet as our compressed packet.
@@ -449,7 +450,8 @@ found:
449 *cpp = ocp; 450 *cpp = ocp;
450 *cp++ = changes; 451 *cp++ = changes;
451 } 452 }
452 cp = put16(cp,(short)deltaA); /* Write TCP checksum */ 453 *(__sum16 *)cp = csum;
454 cp += 2;
453/* deltaS is now the size of the change section of the compressed header */ 455/* deltaS is now the size of the change section of the compressed header */
454 memcpy(cp,new_seq,deltaS); /* Write list of deltas */ 456 memcpy(cp,new_seq,deltaS); /* Write list of deltas */
455 memcpy(cp+deltaS,icp+hlen,isize-hlen); 457 memcpy(cp+deltaS,icp+hlen,isize-hlen);
@@ -519,10 +521,8 @@ slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize)
519 thp = &cs->cs_tcp; 521 thp = &cs->cs_tcp;
520 ip = &cs->cs_ip; 522 ip = &cs->cs_ip;
521 523
522 if((x = pull16(&cp)) == -1) { /* Read the TCP checksum */ 524 thp->check = *(__sum16 *)cp;
523 goto bad; 525 cp += 2;
524 }
525 thp->check = htons(x);
526 526
527 thp->psh = (changes & TCP_PUSH_BIT) ? 1 : 0; 527 thp->psh = (changes & TCP_PUSH_BIT) ? 1 : 0;
528/* 528/*