diff options
author | brian <brian@FreeBSD.org> | 1999-03-29 08:21:28 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-03-29 08:21:28 +0000 |
commit | 539d220871d789543afc7e3744e712d33128ca1b (patch) | |
tree | 22cddce0f60f9ee116dd5d869726e4f1b301b5ee /usr.sbin/ppp/vjcomp.c | |
parent | 1d23653385b701e6ef13bbbe4fb216bab202b990 (diff) | |
download | FreeBSD-src-539d220871d789543afc7e3744e712d33128ca1b.zip FreeBSD-src-539d220871d789543afc7e3744e712d33128ca1b.tar.gz |
Ensure that the thing we're casting to struct ip
is aligned for non-i386 architectures.
Diffstat (limited to 'usr.sbin/ppp/vjcomp.c')
-rw-r--r-- | usr.sbin/ppp/vjcomp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/ppp/vjcomp.c b/usr.sbin/ppp/vjcomp.c index ee5100a..5c257bf 100644 --- a/usr.sbin/ppp/vjcomp.c +++ b/usr.sbin/ppp/vjcomp.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: vjcomp.c,v 1.24 1999/01/28 01:56:34 brian Exp $ + * $Id: vjcomp.c,v 1.25 1999/02/06 02:54:47 brian Exp $ * * TODO: */ @@ -60,14 +60,15 @@ vj_SendFrame(struct link *l, struct mbuf * bp, struct bundle *bundle) { int type; u_short proto; + struct ip *pip; u_short cproto = bundle->ncp.ipcp.peer_compproto >> 16; log_Printf(LogDEBUG, "vj_SendFrame: COMPPROTO = %x\n", bundle->ncp.ipcp.peer_compproto); - if (((struct ip *) MBUF_CTOP(bp))->ip_p == IPPROTO_TCP - && cproto == PROTO_VJCOMP) { - type = sl_compress_tcp(bp, (struct ip *)MBUF_CTOP(bp), - &bundle->ncp.ipcp.vj.cslc, + bp = mbuf_Contiguous(bp); + pip = (struct ip *)MBUF_CTOP(bp); + if (pip->ip_p == IPPROTO_TCP && cproto == PROTO_VJCOMP) { + type = sl_compress_tcp(bp, pip, &bundle->ncp.ipcp.vj.cslc, &bundle->ncp.ipcp.vj.slstat, bundle->ncp.ipcp.peer_compproto & 0xff); log_Printf(LogDEBUG, "vj_SendFrame: type = %x\n", type); @@ -101,6 +102,7 @@ VjUncompressTcp(struct ipcp *ipcp, struct mbuf * bp, u_char type) struct mbuf *nbp; u_char work[MAX_HDR + MAX_VJHEADER]; /* enough to hold TCP/IP header */ + bp = mbuf_Contiguous(bp); olen = len = mbuf_Length(bp); if (type == TYPE_UNCOMPRESSED_TCP) { |