Don't accept IPCP packets before NETWORK phase.

Pointed out by: Ralf Rutherford <ralf@philips.oz.au>
This commit is contained in:
Brian Somers 1998-05-21 01:26:10 +00:00
parent 04eaa58c59
commit 641684cdba
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/cvs2svn/branches/MP/; revision=36269
4 changed files with 19 additions and 11 deletions

View File

@ -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.30.2.43 1998/05/15 18:20:55 brian Exp $
* $Id: ccp.c,v 1.30.2.44 1998/05/15 23:58:16 brian Exp $
*
* TODO:
* o Support other compression protocols
@ -505,9 +505,10 @@ ccp_Input(struct ccp *ccp, struct bundle *bundle, struct mbuf *bp)
/* Got PROTO_CCP from link */
if (bundle_Phase(bundle) == PHASE_NETWORK)
fsm_Input(&ccp->fsm, bp);
else if (bundle_Phase(bundle) < PHASE_NETWORK) {
log_Printf(LogCCP, "%s: Error: Unexpected CCP in phase %s (ignored)\n",
ccp->fsm.link->name, bundle_PhaseName(bundle));
else {
if (bundle_Phase(bundle) < PHASE_NETWORK)
log_Printf(LogCCP, "%s: Error: Unexpected CCP in phase %s (ignored)\n",
ccp->fsm.link->name, bundle_PhaseName(bundle));
mbuf_Free(bp);
}
}

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: hdlc.c,v 1.28.2.35 1998/05/11 23:39:30 brian Exp $
* $Id: hdlc.c,v 1.28.2.36 1998/05/15 18:21:06 brian Exp $
*
* TODO:
*/
@ -421,7 +421,7 @@ hdlc_DecodePacket(struct bundle *bundle, u_short proto, struct mbuf * bp,
ip_Input(bundle, bp);
break;
case PROTO_IPCP:
ipcp_Input(&bundle->ncp.ipcp, bp);
ipcp_Input(&bundle->ncp.ipcp, bundle, bp);
break;
case PROTO_CCP:
ccp_Input(&l->ccp, bundle, bp);

View File

@ -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.50.2.52 1998/05/15 23:58:23 brian Exp $
* $Id: ipcp.c,v 1.50.2.53 1998/05/19 21:51:21 brian Exp $
*
* TODO:
* o More RFC1772 backwoard compatibility
@ -1061,10 +1061,17 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
}
void
ipcp_Input(struct ipcp *ipcp, struct mbuf * bp)
ipcp_Input(struct ipcp *ipcp, struct bundle *bundle, struct mbuf *bp)
{
/* Got PROTO_IPCP from link */
fsm_Input(&ipcp->fsm, bp);
if (bundle_Phase(bundle) == PHASE_NETWORK)
fsm_Input(&ipcp->fsm, bp);
else {
if (bundle_Phase(bundle) < PHASE_NETWORK)
log_Printf(LogIPCP, "%s: Error: Unexpected IPCP in phase %s (ignored)\n",
ipcp->fsm.link->name, bundle_PhaseName(bundle));
mbuf_Free(bp);
}
}
int

View File

@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: ipcp.h,v 1.18.2.26 1998/05/05 23:30:05 brian Exp $
* $Id: ipcp.h,v 1.18.2.27 1998/05/15 23:58:23 brian Exp $
*
* TODO:
*/
@ -105,7 +105,7 @@ extern void ipcp_Setup(struct ipcp *);
extern void ipcp_SetLink(struct ipcp *, struct link *);
extern int ipcp_Show(struct cmdargs const *);
extern void ipcp_Input(struct ipcp *, struct mbuf *);
extern void ipcp_Input(struct ipcp *, struct bundle *, struct mbuf *);
extern void ipcp_AddInOctets(struct ipcp *, int);
extern void ipcp_AddOutOctets(struct ipcp *, int);
extern int ipcp_UseHisaddr(struct bundle *, const char *, int);