diff options
author | brian <brian@FreeBSD.org> | 1999-03-31 13:33:43 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-03-31 13:33:43 +0000 |
commit | b0431d511c2f500f382cf46b881a3379dea7f69c (patch) | |
tree | 9d9b85be827fed0f0addd5e8856abb5b74cedf0b /usr.sbin | |
parent | ba109573e8d6e168afc0cac2a1a832dab5252c8a (diff) | |
download | FreeBSD-src-b0431d511c2f500f382cf46b881a3379dea7f69c.zip FreeBSD-src-b0431d511c2f500f382cf46b881a3379dea7f69c.tar.gz |
Another alignment bogon.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/slcompress.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/ppp/slcompress.c b/usr.sbin/ppp/slcompress.c index 7eab5e7..1de6465 100644 --- a/usr.sbin/ppp/slcompress.c +++ b/usr.sbin/ppp/slcompress.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: slcompress.c,v 1.21 1999/01/28 01:56:34 brian Exp $ + * $Id: slcompress.c,v 1.22 1999/03/30 07:57:22 brian Exp $ * * Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989: * - Initial distribution. @@ -551,13 +551,17 @@ sl_uncompress_tcp(u_char ** bufp, int len, u_int type, struct slcompress *comp, /* recompute the ip header checksum */ { - register u_short *bp = (u_short *)&cs->cs_ip; + register u_short sum, *bp = (u_short *)&cs->cs_ip; for (changes = 0; hlen > 0; hlen -= 2) changes += *bp++; changes = (changes & 0xffff) + (changes >> 16); changes = (changes & 0xffff) + (changes >> 16); - ((struct ip *) cp)->ip_sum = ~changes; + + /* Watch out for alighment problems.... */ + sum = ~changes; + bp = &((struct ip *)cp)->ip_sum; + memcpy(bp, &sum, sizeof *bp); } return (len); bad: |