diff options
| author | Brian Somers <brian@FreeBSD.org> | 1999-02-20 01:12:45 +0000 |
|---|---|---|
| committer | Brian Somers <brian@FreeBSD.org> | 1999-02-20 01:12:45 +0000 |
| commit | b7ff18add268c0cdebd78a36346115d250de2c84 (patch) | |
| tree | 0c0f8932acf91b42436aed712cd0f6ccb7998aab /usr.sbin | |
| parent | d894d5dedb4211757bde7ad7e435b4a29c597a6e (diff) | |
Notes
Diffstat (limited to 'usr.sbin')
| -rw-r--r-- | usr.sbin/ppp/auth.c | 7 | ||||
| -rw-r--r-- | usr.sbin/ppp/chap.c | 7 | ||||
| -rw-r--r-- | usr.sbin/ppp/pap.c | 7 |
3 files changed, 14 insertions, 7 deletions
diff --git a/usr.sbin/ppp/auth.c b/usr.sbin/ppp/auth.c index be25ddd5d1c7..d67aedaea053 100644 --- a/usr.sbin/ppp/auth.c +++ b/usr.sbin/ppp/auth.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: auth.c,v 1.39 1999/02/18 00:52:12 brian Exp $ + * $Id: auth.c,v 1.40 1999/02/19 10:48:42 brian Exp $ * * TODO: * o Implement check against with registered IP addresses. @@ -327,11 +327,14 @@ auth_ReadHeader(struct authinfo *authp, struct mbuf *bp) bp = mbuf_Read(bp, (u_char *)&authp->in.hdr, sizeof authp->in.hdr); if (len >= ntohs(authp->in.hdr.length)) return bp; + authp->in.hdr.length = htons(0); log_Printf(LogWARN, "auth_ReadHeader: Short packet (%d > %d) !\n", ntohs(authp->in.hdr.length), len); - } else + } else { + authp->in.hdr.length = htons(0); log_Printf(LogWARN, "auth_ReadHeader: Short packet header (%d > %d) !\n", sizeof authp->in.hdr, len); + } mbuf_Free(bp); return NULL; diff --git a/usr.sbin/ppp/chap.c b/usr.sbin/ppp/chap.c index 24127a921d39..fe76ebc216bc 100644 --- a/usr.sbin/ppp/chap.c +++ b/usr.sbin/ppp/chap.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: chap.c,v 1.45 1999/02/18 19:11:46 brian Exp $ + * $Id: chap.c,v 1.46 1999/02/18 19:45:06 brian Exp $ * * TODO: */ @@ -543,8 +543,9 @@ chap_Input(struct physical *p, struct mbuf *bp) int lanman; #endif - if ((bp = auth_ReadHeader(&chap->auth, bp)) == NULL) - log_Printf(LogERROR, "Chap Input: Truncated header !\n"); + if ((bp = auth_ReadHeader(&chap->auth, bp)) == NULL && + ntohs(chap->auth.in.hdr.length) == 0) + log_Printf(LogWARN, "Chap Input: Truncated header !\n"); else if (chap->auth.in.hdr.code == 0 || chap->auth.in.hdr.code > MAXCHAPCODE) log_Printf(LogPHASE, "Chap Input: %d: Bad CHAP code !\n", chap->auth.in.hdr.code); diff --git a/usr.sbin/ppp/pap.c b/usr.sbin/ppp/pap.c index 10be5776d5e1..681f90dbe315 100644 --- a/usr.sbin/ppp/pap.c +++ b/usr.sbin/ppp/pap.c @@ -18,7 +18,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: pap.c,v 1.30 1999/02/02 09:35:17 brian Exp $ + * $Id: pap.c,v 1.31 1999/02/06 02:54:47 brian Exp $ * * TODO: */ @@ -155,8 +155,11 @@ pap_Input(struct physical *p, struct mbuf *bp) struct authinfo *authp = &p->dl->pap; u_char nlen, klen, *key; - if ((bp = auth_ReadHeader(authp, bp)) == NULL) + if ((bp = auth_ReadHeader(authp, bp)) == NULL && + ntohs(authp->in.hdr.length) == 0) { + log_Printf(LogWARN, "Pap Input: Truncated header !\n"); return; + } if (authp->in.hdr.code == 0 || authp->in.hdr.code > MAXPAPCODE) { log_Printf(LogPHASE, "Pap Input: %d: Bad PAP code !\n", authp->in.hdr.code); |
