diff options
author | brian <brian@cvs.openbsd.org> | 1999-03-11 01:50:05 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 1999-03-11 01:50:05 +0000 |
commit | e7037124ba02d2000ee00b30084fefacb7b7f3bf (patch) | |
tree | a0dc9f17ff6a2cd1d12b5567d660c59d966bf7b8 | |
parent | b3ede3ba86748e4de8ce13bd3a82cd3fc08d205a (diff) |
Tone down the log levels (Log{ERROR,WARN} -> LogCCP)
when we've simply missed a packet.
When our Predictor1 CRC is wrong (implying we've dropped
a packet), don't send a ResetReq(). Instead, send another
CCP ConfigReq(). *shrug* My tests show this as being far
worse than the ResetReq as we may have further Nak/Rejs etc
and we're basically resetting both our incoming and outgoing
compression dictionaries, but rfc1978 says the ConfigReq is
correct, so we'd better go along...
-rw-r--r-- | usr.sbin/ppp/ppp/ccp.c | 10 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/deflate.c | 12 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/pred.c | 12 |
3 files changed, 18 insertions, 16 deletions
diff --git a/usr.sbin/ppp/ppp/ccp.c b/usr.sbin/ppp/ppp/ccp.c index 6b298121b95..be3f62fa765 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.3 1999/02/26 21:28:20 brian Exp $ + * $Id: ccp.c,v 1.4 1999/03/11 01:50:04 brian Exp $ * * TODO: * o Support other compression protocols @@ -548,17 +548,17 @@ CcpRecvResetAck(struct fsm *fp, u_char id) if (ccp->reset_sent != -1) { if (id != ccp->reset_sent) { - log_Printf(LogWARN, "CCP: %s: Incorrect ResetAck (id %d, not %d)" + log_Printf(LogCCP, "%s: Incorrect ResetAck (id %d, not %d)" " ignored\n", fp->link->name, id, ccp->reset_sent); return; } /* Whaddaya know - a correct reset ack */ } else if (id == ccp->last_reset) log_Printf(LogCCP, "%s: Duplicate ResetAck (resetting again)\n", - fp->link->name); + fp->link->name); else { - log_Printf(LogWARN, "CCP: %s: Unexpected ResetAck (id %d) ignored\n", - fp->link->name, id); + log_Printf(LogCCP, "%s: Unexpected ResetAck (id %d) ignored\n", + fp->link->name, id); return; } diff --git a/usr.sbin/ppp/ppp/deflate.c b/usr.sbin/ppp/ppp/deflate.c index 69c1a7e6b1f..6a35470686f 100644 --- a/usr.sbin/ppp/ppp/deflate.c +++ b/usr.sbin/ppp/ppp/deflate.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: deflate.c,v 1.2 1999/02/06 03:22:35 brian Exp $ + * $Id: deflate.c,v 1.3 1999/03/11 01:50:04 brian Exp $ */ #include <sys/types.h> @@ -222,7 +222,7 @@ DeflateInput(void *v, struct ccp *ccp, u_short *proto, struct mbuf *mi) */ state->seqno = seq; else { - log_Printf(LogWARN, "DeflateInput: Seq error: Got %d, expected %d\n", + log_Printf(LogCCP, "DeflateInput: Seq error: Got %d, expected %d\n", seq, state->seqno); mbuf_Free(mi_head); ccp_SendResetReq(&ccp->fsm); @@ -258,7 +258,7 @@ DeflateInput(void *v, struct ccp *ccp, u_short *proto, struct mbuf *mi) if ((res = inflate(&state->cx, flush)) != Z_OK) { if (res == Z_STREAM_END) break; /* Done */ - log_Printf(LogWARN, "DeflateInput: inflate returned %d (%s)\n", + log_Printf(LogCCP, "DeflateInput: inflate returned %d (%s)\n", res, state->cx.msg ? state->cx.msg : ""); mbuf_Free(mo_head); mbuf_Free(mi); @@ -302,7 +302,7 @@ DeflateInput(void *v, struct ccp *ccp, u_short *proto, struct mbuf *mi) mbuf_Free(mi); if (first) { - log_Printf(LogWARN, "DeflateInput: Length error\n"); + log_Printf(LogCCP, "DeflateInput: Length error\n"); mbuf_Free(mo_head); ccp_SendResetReq(&ccp->fsm); return NULL; @@ -383,9 +383,9 @@ DeflateDictSetup(void *v, struct ccp *ccp, u_short proto, struct mbuf *mi) break; /* Done */ if (expect_error && res == Z_BUF_ERROR) break; - log_Printf(LogERROR, "DeflateDictSetup: inflate returned %d (%s)\n", + log_Printf(LogCCP, "DeflateDictSetup: inflate returned %d (%s)\n", res, state->cx.msg ? state->cx.msg : ""); - log_Printf(LogERROR, "DeflateDictSetup: avail_in %d, avail_out %d\n", + log_Printf(LogCCP, "DeflateDictSetup: avail_in %d, avail_out %d\n", state->cx.avail_in, state->cx.avail_out); ccp_SendResetReq(&ccp->fsm); mbuf_FreeSeg(mi_head); /* lose our allocated ``head'' buf */ diff --git a/usr.sbin/ppp/ppp/pred.c b/usr.sbin/ppp/ppp/pred.c index dce5ec49949..a83c291e0b9 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.2 1999/02/06 03:22:43 brian Exp $ + * $Id: pred.c,v 1.3 1999/03/11 01:50:04 brian Exp $ */ #include <sys/types.h> @@ -43,6 +43,8 @@ #include "hdlc.h" #include "lcp.h" #include "ccp.h" +#include "throughput.h" +#include "link.h" #include "pred.h" /* The following hash code is the heart of the algorithm: @@ -232,8 +234,8 @@ Pred1Input(void *v, struct ccp *ccp, u_short *proto, struct mbuf *bp) ccp->compin += olen; len &= 0x7fff; if (len != len1) { /* Error is detected. Send reset request */ - log_Printf(LogCCP, "Pred1: Length error\n"); - ccp_SendResetReq(&ccp->fsm); + log_Printf(LogCCP, "Pred1: Length error (got %d, not %d)\n", len1, len); + fsm_Reopen(&ccp->fsm); mbuf_Free(bp); mbuf_Free(wp); return NULL; @@ -269,8 +271,8 @@ Pred1Input(void *v, struct ccp *ccp, u_short *proto, struct mbuf *bp) mbuf_Free(bp); return wp; } else { - log_DumpBp(LogHDLC, "Bad FCS", wp); - ccp_SendResetReq(&ccp->fsm); + log_Printf(LogCCP, "%s: Bad CRC-16\n", ccp->fsm.link->name); + fsm_Reopen(&ccp->fsm); mbuf_Free(wp); } mbuf_Free(bp); |