summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>1999-05-09 20:04:05 +0000
committerbrian <brian@cvs.openbsd.org>1999-05-09 20:04:05 +0000
commitf0905c97610d71420d13e18af7975fdde2e6ad72 (patch)
treee5823e0d39f8a9922547a1e8f9e8cbb6c970532b /usr.sbin
parentf8c4bff77a499dd4cde6b74ac4bbc4c8f9aed0d4 (diff)
Deal with the fact that as we now mbuf_Read the fsm
header in fsm_Input() we often end up with a NULL mbuf. Deal with a possible NULL mbuf being passed into mbuf_Prepend(). Adjust some spacing to make things more consistent.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/ppp/ccp.c6
-rw-r--r--usr.sbin/ppp/ppp/fsm.c54
-rw-r--r--usr.sbin/ppp/ppp/ip.c4
-rw-r--r--usr.sbin/ppp/ppp/ipcp.c4
-rw-r--r--usr.sbin/ppp/ppp/lcp.c10
-rw-r--r--usr.sbin/ppp/ppp/log.c4
-rw-r--r--usr.sbin/ppp/ppp/lqr.c21
-rw-r--r--usr.sbin/ppp/ppp/lqr.h4
-rw-r--r--usr.sbin/ppp/ppp/mbuf.c54
-rw-r--r--usr.sbin/ppp/ppp/mbuf.h9
-rw-r--r--usr.sbin/ppp/ppp/pred.c4
-rw-r--r--usr.sbin/ppp/ppp/slcompress.c4
-rw-r--r--usr.sbin/ppp/ppp/systems.c4
-rw-r--r--usr.sbin/ppp/ppp/timer.c8
-rw-r--r--usr.sbin/ppp/ppp/vjcomp.c4
15 files changed, 98 insertions, 96 deletions
diff --git a/usr.sbin/ppp/ppp/ccp.c b/usr.sbin/ppp/ppp/ccp.c
index 696599af2d4..1cdf996398e 100644
--- a/usr.sbin/ppp/ppp/ccp.c
+++ b/usr.sbin/ppp/ppp/ccp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ccp.c,v 1.7 1999/05/08 11:06:34 brian Exp $
+ * $Id: ccp.c,v 1.8 1999/05/09 20:03:59 brian Exp $
*
* TODO:
* o Support other compression protocols
@@ -363,9 +363,7 @@ CcpLayerFinish(struct fsm *fp)
log_Printf(LogCCP, "%s: LayerFinish.\n", fp->link->name);
}
-/*
- * Called when CCP has reached the OPEN state
- */
+/* Called when CCP has reached the OPEN state */
static int
CcpLayerUp(struct fsm *fp)
{
diff --git a/usr.sbin/ppp/ppp/fsm.c b/usr.sbin/ppp/ppp/fsm.c
index 416deb208b6..61bd3363c02 100644
--- a/usr.sbin/ppp/ppp/fsm.c
+++ b/usr.sbin/ppp/ppp/fsm.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: fsm.c,v 1.7 1999/05/08 11:06:35 brian Exp $
+ * $Id: fsm.c,v 1.8 1999/05/09 20:03:59 brian Exp $
*
* TODO:
*/
@@ -156,7 +156,7 @@ fsm_Init(struct fsm *fp, const char *name, u_short proto, int mincode,
}
static void
-NewState(struct fsm * fp, int new)
+NewState(struct fsm *fp, int new)
{
log_Printf(fp->LogLevel, "%s: State change %s --> %s\n",
fp->link->name, State2Nam(fp->state), State2Nam(new));
@@ -237,7 +237,7 @@ FsmOpenNow(void *v)
}
void
-fsm_Open(struct fsm * fp)
+fsm_Open(struct fsm *fp)
{
switch (fp->state) {
case ST_INITIAL:
@@ -275,7 +275,7 @@ fsm_Open(struct fsm * fp)
}
void
-fsm_Up(struct fsm * fp)
+fsm_Up(struct fsm *fp)
{
switch (fp->state) {
case ST_INITIAL:
@@ -363,7 +363,7 @@ fsm_Close(struct fsm *fp)
* Send functions
*/
static void
-FsmSendConfigReq(struct fsm * fp)
+FsmSendConfigReq(struct fsm *fp)
{
if (fp->more.reqs-- > 0 && fp->restart-- > 0) {
(*fp->fn->SendConfigReq)(fp);
@@ -442,7 +442,7 @@ FsmInitRestartCounter(struct fsm *fp, int what)
}
/*
- * Actions when receive packets
+ * Actions when receive packets
*/
static void
FsmRecvConfigReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
@@ -461,17 +461,13 @@ FsmRecvConfigReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
return;
}
- /*
- * Check and process easy case
- */
+ /* Check and process easy case */
switch (fp->state) {
case ST_INITIAL:
if (fp->proto == PROTO_CCP && fp->link->lcp.fsm.state == ST_OPENED) {
/*
* ccp_SetOpenMode() leaves us in initial if we're disabling
* & denying everything.
- *
- * this is a bit smelly... we know that bp has a leading fsmheader.
*/
bp = mbuf_Prepend(bp, lhp, sizeof *lhp, 2);
bp = proto_Prepend(bp, fp->proto, 0, 0);
@@ -503,7 +499,6 @@ FsmRecvConfigReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
}
bp = mbuf_Contiguous(bp);
-
dec.ackend = dec.ack;
dec.nakend = dec.nak;
dec.rejend = dec.rej;
@@ -662,6 +657,7 @@ FsmRecvConfigNak(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
return;
}
+ bp = mbuf_Contiguous(bp);
dec.ackend = dec.ack;
dec.nakend = dec.nak;
dec.rejend = dec.rej;
@@ -727,7 +723,7 @@ FsmRecvTermReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
}
static void
-FsmRecvTermAck(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
+FsmRecvTermAck(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
/* RTA */
{
switch (fp->state) {
@@ -789,6 +785,7 @@ FsmRecvConfigRej(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
return;
}
+ bp = mbuf_Contiguous(bp);
dec.ackend = dec.ack;
dec.nakend = dec.nak;
dec.rejend = dec.rej;
@@ -826,11 +823,14 @@ static void
FsmRecvProtoRej(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
{
struct physical *p = link2physical(fp->link);
- u_short *sp, proto;
+ u_short proto;
- bp = mbuf_Contiguous(bp);
- sp = (u_short *)MBUF_CTOP(bp);
- proto = ntohs(*sp);
+ if (mbuf_Length(bp) < 2) {
+ mbuf_Free(bp);
+ return;
+ }
+ bp = mbuf_Read(bp, &proto, 2);
+ proto = ntohs(proto);
log_Printf(fp->LogLevel, "%s: -- Protocol 0x%04x (%s) was rejected!\n",
fp->link->name, proto, hdlc_Protocol2Nam(proto));
@@ -881,7 +881,7 @@ FsmRecvEchoReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
u_char *cp;
u_int32_t magic;
- if (lcp) {
+ if (lcp && mbuf_Length(bp) >= 4) {
cp = MBUF_CTOP(bp);
ua_ntohl(cp, &magic);
if (magic != lcp->his_magic) {
@@ -903,37 +903,37 @@ FsmRecvEchoRep(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
struct lcp *lcp = fsm2lcp(fp);
u_int32_t magic;
- if (lcp) {
- ua_ntohl(MBUF_CTOP(bp), &magic);
+ if (lcp && mbuf_Length(bp) >= 4) {
+ mbuf_Read(bp, &magic, 4);
+ magic = ntohl(magic);
/* Tolerate echo replies with either magic number */
if (magic != 0 && magic != lcp->his_magic && magic != lcp->want_magic) {
- log_Printf(LogWARN,
- "%s: RecvEchoRep: Bad magic: expected 0x%08x, got: 0x%08x\n",
- fp->link->name, lcp->his_magic, magic);
+ log_Printf(LogWARN, "%s: RecvEchoRep: Bad magic: expected 0x%08x,"
+ " got 0x%08x\n", fp->link->name, lcp->his_magic, magic);
/*
* XXX: We should send terminate request. But poor implementations may
* die as a result.
*/
}
- lqr_RecvEcho(fp, bp);
+ bp = lqr_RecvEcho(fp, bp);
}
mbuf_Free(bp);
}
static void
-FsmRecvDiscReq(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
+FsmRecvDiscReq(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
{
mbuf_Free(bp);
}
static void
-FsmRecvIdent(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
+FsmRecvIdent(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
{
mbuf_Free(bp);
}
static void
-FsmRecvTimeRemain(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
+FsmRecvTimeRemain(struct fsm *fp, struct fsmheader *lhp, struct mbuf *bp)
{
mbuf_Free(bp);
}
diff --git a/usr.sbin/ppp/ppp/ip.c b/usr.sbin/ppp/ppp/ip.c
index 595737f6303..d680676a75a 100644
--- a/usr.sbin/ppp/ppp/ip.c
+++ b/usr.sbin/ppp/ppp/ip.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ip.c,v 1.8 1999/05/08 11:06:35 brian Exp $
+ * $Id: ip.c,v 1.9 1999/05/09 20:04:00 brian Exp $
*
* TODO:
* o Return ICMP message for filterd packet
@@ -232,7 +232,7 @@ FilterCheck(struct ip *pip, struct filter *filter)
#ifdef notdef
static void
-IcmpError(struct ip * pip, int code)
+IcmpError(struct ip *pip, int code)
{
struct mbuf *bp;
diff --git a/usr.sbin/ppp/ppp/ipcp.c b/usr.sbin/ppp/ppp/ipcp.c
index 5da1fa52538..1454d218598 100644
--- a/usr.sbin/ppp/ppp/ipcp.c
+++ b/usr.sbin/ppp/ppp/ipcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ipcp.c,v 1.12 1999/05/08 11:06:35 brian Exp $
+ * $Id: ipcp.c,v 1.13 1999/05/09 20:04:00 brian Exp $
*
* TODO:
* o Support IPADDRS properly
@@ -795,7 +795,7 @@ AcceptableAddr(const struct in_range *prange, struct in_addr ipaddr)
}
static void
-IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
+IpcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
struct fsm_decode *dec)
{
/* Deal with incoming PROTO_IPCP */
diff --git a/usr.sbin/ppp/ppp/lcp.c b/usr.sbin/ppp/ppp/lcp.c
index e651a358921..9afa0303f18 100644
--- a/usr.sbin/ppp/ppp/lcp.c
+++ b/usr.sbin/ppp/ppp/lcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: lcp.c,v 1.12 1999/05/08 11:06:36 brian Exp $
+ * $Id: lcp.c,v 1.13 1999/05/09 20:04:01 brian Exp $
*
*/
@@ -874,9 +874,7 @@ LcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
dec->ackend += 2;
} else {
#ifdef OLDMST
- /*
- * MorningStar before v1.3 needs NAK
- */
+ /* MorningStar before v1.3 needs NAK */
memcpy(dec->nakend, cp, 2);
dec->nakend += 2;
#else
@@ -902,9 +900,7 @@ LcpDecodeConfig(struct fsm *fp, u_char *cp, int plen, int mode_type,
dec->ackend += 2;
} else {
#ifdef OLDMST
- /*
- * MorningStar before v1.3 needs NAK
- */
+ /* MorningStar before v1.3 needs NAK */
memcpy(dec->nakend, cp, 2);
dec->nakend += 2;
#else
diff --git a/usr.sbin/ppp/ppp/log.c b/usr.sbin/ppp/ppp/log.c
index 528b1d511f5..ad009b1e04f 100644
--- a/usr.sbin/ppp/ppp/log.c
+++ b/usr.sbin/ppp/ppp/log.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: log.c,v 1.3 1999/03/07 11:55:26 brian Exp $
+ * $Id: log.c,v 1.4 1999/05/09 20:04:01 brian Exp $
*/
#include <sys/types.h>
@@ -364,7 +364,7 @@ log_DumpBp(int lev, const char *hdr, const struct mbuf *bp)
}
void
-log_DumpBuff(int lev, const char *hdr, const u_char * ptr, int n)
+log_DumpBuff(int lev, const char *hdr, const u_char *ptr, int n)
{
if (log_IsKept(lev)) {
char buf[50];
diff --git a/usr.sbin/ppp/ppp/lqr.c b/usr.sbin/ppp/ppp/lqr.c
index 7259ff18c25..e16d11b4fb3 100644
--- a/usr.sbin/ppp/ppp/lqr.c
+++ b/usr.sbin/ppp/ppp/lqr.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: lqr.c,v 1.4 1999/05/08 11:06:37 brian Exp $
+ * $Id: lqr.c,v 1.5 1999/05/09 20:04:02 brian Exp $
*
* o LQR based on RFC1333
*
@@ -78,17 +78,17 @@ SendEchoReq(struct lcp *lcp)
(u_char *)&echo, sizeof echo);
}
-void
-lqr_RecvEcho(struct fsm *fp, struct mbuf * bp)
+struct mbuf *
+lqr_RecvEcho(struct fsm *fp, struct mbuf *bp)
{
struct hdlc *hdlc = &link2physical(fp->link)->hdlc;
- struct echolqr *lqr;
+ struct echolqr lqr;
u_int32_t seq;
- if (mbuf_Length(bp) == sizeof(struct echolqr)) {
- lqr = (struct echolqr *) MBUF_CTOP(bp);
- if (ntohl(lqr->signature) == SIGNATURE) {
- seq = ntohl(lqr->sequence);
+ if (mbuf_Length(bp) == sizeof lqr) {
+ mbuf_Read(bp, &lqr, sizeof lqr);
+ if (ntohl(lqr.signature) == SIGNATURE) {
+ seq = ntohl(lqr.sequence);
/* careful not to update lqm.echo.seq_recv with older values */
if ((hdlc->lqm.echo.seq_recv > (u_int32_t)0 - 5 && seq < 5) ||
(hdlc->lqm.echo.seq_recv <= (u_int32_t)0 - 5 &&
@@ -96,14 +96,15 @@ lqr_RecvEcho(struct fsm *fp, struct mbuf * bp)
hdlc->lqm.echo.seq_recv = seq;
} else
log_Printf(LogWARN, "lqr_RecvEcho: Got sig 0x%08lx, not 0x%08lx !\n",
- (u_long)ntohl(lqr->signature), (u_long)SIGNATURE);
+ (u_long)ntohl(lqr.signature), (u_long)SIGNATURE);
} else
log_Printf(LogWARN, "lqr_RecvEcho: Got packet size %d, expecting %ld !\n",
mbuf_Length(bp), (long)sizeof(struct echolqr));
+ return bp;
}
void
-lqr_ChangeOrder(struct lqrdata * src, struct lqrdata * dst)
+lqr_ChangeOrder(struct lqrdata *src, struct lqrdata *dst)
{
u_int32_t *sp, *dp;
int n;
diff --git a/usr.sbin/ppp/ppp/lqr.h b/usr.sbin/ppp/ppp/lqr.h
index 44ffaa026b2..728f704dbf4 100644
--- a/usr.sbin/ppp/ppp/lqr.h
+++ b/usr.sbin/ppp/ppp/lqr.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: lqr.h,v 1.3 1999/05/08 11:06:37 brian Exp $
+ * $Id: lqr.h,v 1.4 1999/05/09 20:04:02 brian Exp $
*
* TODO:
*/
@@ -57,7 +57,7 @@ extern void lqr_Start(struct lcp *);
extern void lqr_reStart(struct lcp *);
extern void lqr_Stop(struct physical *, int);
extern void lqr_StopTimer(struct physical *);
-extern void lqr_RecvEcho(struct fsm *, struct mbuf *);
+extern struct mbuf *lqr_RecvEcho(struct fsm *, struct mbuf *);
extern struct mbuf *lqr_Input(struct bundle *, struct link *, struct mbuf *);
extern struct layer lqrlayer;
diff --git a/usr.sbin/ppp/ppp/mbuf.c b/usr.sbin/ppp/ppp/mbuf.c
index 004d65d30fb..34fe4ff8b51 100644
--- a/usr.sbin/ppp/ppp/mbuf.c
+++ b/usr.sbin/ppp/ppp/mbuf.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: mbuf.c,v 1.4 1999/05/08 11:06:37 brian Exp $
+ * $Id: mbuf.c,v 1.5 1999/05/09 20:04:02 brian Exp $
*
*/
#include <sys/types.h>
@@ -45,13 +45,13 @@ static int totalalloced;
static unsigned long long mbuf_Mallocs, mbuf_Frees;
int
-mbuf_Length(struct mbuf * bp)
+mbuf_Length(struct mbuf *bp)
{
int len;
for (len = 0; bp; bp = bp->next)
len += bp->cnt;
- return (len);
+ return len;
}
struct mbuf *
@@ -155,7 +155,7 @@ mbuf_Prepend(struct mbuf *bp, const void *ptr, size_t len, size_t extra)
{
struct mbuf *head;
- if (bp->offset) {
+ if (bp && bp->offset) {
if (bp->offset >= len) {
bp->offset -= len;
bp->cnt += len;
@@ -168,7 +168,7 @@ mbuf_Prepend(struct mbuf *bp, const void *ptr, size_t len, size_t extra)
bp->offset = 0;
}
- head = mbuf_Alloc(len + extra, bp->type);
+ head = mbuf_Alloc(len + extra, bp ? bp->type : MB_FSM);
head->offset = extra;
head->cnt -= extra;
memcpy(MBUF_CTOP(head), ptr, len);
@@ -274,13 +274,15 @@ mbuf_Dequeue(struct mqueue *q)
void
mbuf_Enqueue(struct mqueue *queue, struct mbuf *bp)
{
- if (queue->last) {
- queue->last->pnext = bp;
- queue->last = bp;
- } else
- queue->last = queue->top = bp;
- queue->qlen++;
- log_Printf(LogDEBUG, "mbuf_Enqueue: len = %d\n", queue->qlen);
+ if (bp != NULL) {
+ if (queue->last) {
+ queue->last->pnext = bp;
+ queue->last = bp;
+ } else
+ queue->last = queue->top = bp;
+ queue->qlen++;
+ log_Printf(LogDEBUG, "mbuf_Enqueue: len = %d\n", queue->qlen);
+ }
}
struct mbuf *
@@ -288,24 +290,26 @@ mbuf_Contiguous(struct mbuf *bp)
{
/* Put it all in one contigous (aligned) mbuf */
- if (bp->next != NULL) {
- struct mbuf *nbp;
- u_char *cp;
+ if (bp != NULL) {
+ if (bp->next != NULL) {
+ struct mbuf *nbp;
+ u_char *cp;
- nbp = mbuf_Alloc(mbuf_Length(bp), bp->type);
+ nbp = mbuf_Alloc(mbuf_Length(bp), bp->type);
- for (cp = MBUF_CTOP(nbp); bp; bp = mbuf_FreeSeg(bp)) {
- memcpy(cp, MBUF_CTOP(bp), bp->cnt);
- cp += bp->cnt;
+ for (cp = MBUF_CTOP(nbp); bp; bp = mbuf_FreeSeg(bp)) {
+ memcpy(cp, MBUF_CTOP(bp), bp->cnt);
+ cp += bp->cnt;
+ }
+ bp = nbp;
}
- bp = nbp;
- }
#ifndef __i386__ /* Do any other archs not care about alignment ? */
- else if ((bp->offset & 0x03) != 0) {
- bcopy(MBUF_CTOP(bp), bp + 1, bp->cnt);
- bp->offset = 0;
- }
+ else if ((bp->offset & 0x03) != 0) {
+ bcopy(MBUF_CTOP(bp), bp + 1, bp->cnt);
+ bp->offset = 0;
+ }
#endif
+ }
return bp;
}
diff --git a/usr.sbin/ppp/ppp/mbuf.h b/usr.sbin/ppp/ppp/mbuf.h
index d80d90df511..e546e136941 100644
--- a/usr.sbin/ppp/ppp/mbuf.h
+++ b/usr.sbin/ppp/ppp/mbuf.h
@@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: mbuf.h,v 1.4 1999/05/08 11:06:37 brian Exp $
+ * $Id: mbuf.h,v 1.5 1999/05/09 20:04:03 brian Exp $
*
* TODO:
*/
@@ -36,8 +36,11 @@ struct mqueue {
int qlen;
};
-#define MBUF_CTOP(bp) ((u_char *)((bp)+1) + (bp)->offset)
-#define CONST_MBUF_CTOP(bp) ((const u_char *)((bp)+1) + (bp)->offset)
+#define MBUF_CTOP(bp) \
+ ((bp) ? (u_char *)((bp)+1) + (bp)->offset : NULL)
+
+#define CONST_MBUF_CTOP(bp) \
+ ((bp) ? (const u_char *)((bp)+1) + (bp)->offset : NULL)
#define MB_ASYNC 1
#define MB_FSM 2
diff --git a/usr.sbin/ppp/ppp/pred.c b/usr.sbin/ppp/ppp/pred.c
index 0d251cfc2a6..66bd51b0e14 100644
--- a/usr.sbin/ppp/ppp/pred.c
+++ b/usr.sbin/ppp/ppp/pred.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pred.c,v 1.5 1999/05/08 11:06:39 brian Exp $
+ * $Id: pred.c,v 1.6 1999/05/09 20:04:03 brian Exp $
*/
#include <sys/types.h>
@@ -287,7 +287,7 @@ Pred1Input(void *v, struct ccp *ccp, u_short *proto, struct mbuf *bp)
}
static void
-Pred1DictSetup(void *v, struct ccp *ccp, u_short proto, struct mbuf * bp)
+Pred1DictSetup(void *v, struct ccp *ccp, u_short proto, struct mbuf *bp)
{
}
diff --git a/usr.sbin/ppp/ppp/slcompress.c b/usr.sbin/ppp/ppp/slcompress.c
index 936c6bfe969..34dffbb28dd 100644
--- a/usr.sbin/ppp/ppp/slcompress.c
+++ b/usr.sbin/ppp/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.6 1999/05/08 11:06:39 brian Exp $
+ * $Id: slcompress.c,v 1.7 1999/05/09 20:04:03 brian Exp $
*
* Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989:
* - Initial distribution.
@@ -60,7 +60,7 @@
#include "bundle.h"
void
-sl_compress_init(struct slcompress * comp, int max_state)
+sl_compress_init(struct slcompress *comp, int max_state)
{
register u_int i;
register struct cstate *tstate = comp->tstate;
diff --git a/usr.sbin/ppp/ppp/systems.c b/usr.sbin/ppp/ppp/systems.c
index 83d17d7364e..ac057a30f5d 100644
--- a/usr.sbin/ppp/ppp/systems.c
+++ b/usr.sbin/ppp/ppp/systems.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: systems.c,v 1.7 1999/05/08 11:06:40 brian Exp $
+ * $Id: systems.c,v 1.8 1999/05/09 20:04:03 brian Exp $
*
* TODO:
*/
@@ -53,7 +53,7 @@ OpenSecret(const char *file)
}
void
-CloseSecret(FILE * fp)
+CloseSecret(FILE *fp)
{
fclose(fp);
}
diff --git a/usr.sbin/ppp/ppp/timer.c b/usr.sbin/ppp/ppp/timer.c
index 1ff1fc8a8d0..43f30b8193f 100644
--- a/usr.sbin/ppp/ppp/timer.c
+++ b/usr.sbin/ppp/ppp/timer.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: timer.c,v 1.3 1999/02/06 03:22:49 brian Exp $
+ * $Id: timer.c,v 1.4 1999/05/09 20:04:04 brian Exp $
*
* TODO:
*/
@@ -49,7 +49,7 @@ tState2Nam(u_int state)
}
void
-timer_Stop(struct pppTimer * tp)
+timer_Stop(struct pppTimer *tp)
{
int omask;
@@ -59,7 +59,7 @@ timer_Stop(struct pppTimer * tp)
}
void
-timer_Start(struct pppTimer * tp)
+timer_Start(struct pppTimer *tp)
{
struct pppTimer *t, *pt;
u_long ticks = 0;
@@ -107,7 +107,7 @@ timer_Start(struct pppTimer * tp)
}
static void
-StopTimerNoBlock(struct pppTimer * tp)
+StopTimerNoBlock(struct pppTimer *tp)
{
struct pppTimer *t, *pt;
diff --git a/usr.sbin/ppp/ppp/vjcomp.c b/usr.sbin/ppp/ppp/vjcomp.c
index 5de688b78c7..0d31e8fb7b4 100644
--- a/usr.sbin/ppp/ppp/vjcomp.c
+++ b/usr.sbin/ppp/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.5 1999/05/08 11:06:40 brian Exp $
+ * $Id: vjcomp.c,v 1.6 1999/05/09 20:04:04 brian Exp $
*
* TODO:
*/
@@ -99,7 +99,7 @@ vj_LayerPush(struct bundle *bundle, struct link *l, struct mbuf *bp, int pri,
}
static struct mbuf *
-VjUncompressTcp(struct ipcp *ipcp, struct mbuf * bp, u_char type)
+VjUncompressTcp(struct ipcp *ipcp, struct mbuf *bp, u_char type)
{
u_char *bufp;
int len, olen, rlen;