Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79266
b: refs/heads/master
c: 7cd6188
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro authored and David S. Miller committed Jan 28, 2008
1 parent 60a0d3b commit f734d46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3dd5f1d422d8a736178a760562c98d4169b33a23
refs/heads/master: 7cd61888d2ab9fa7e08205b18a24885e523df048
12 changes: 6 additions & 6 deletions trunk/drivers/net/slhc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;


/*
Expand Down Expand Up @@ -428,7 +429,7 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize,
/* 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.
Expand All @@ -449,7 +450,8 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize,
*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);
Expand Down Expand Up @@ -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;
/*
Expand Down

0 comments on commit f734d46

Please sign in to comment.