* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define RCSID "$Id: ipcp.c,v 1.62 2002/12/04 23:03:32 paulus Exp $"
+#define RCSID "$Id: ipcp.c,v 1.64 2003/07/28 12:25:41 carlsonj Exp $"
/*
* TODO:
static int proxy_arp_set[NUM_PPP]; /* Have created proxy arp entry */
static bool usepeerdns; /* Ask peer for DNS addrs */
static int ipcp_is_up; /* have called np_up() */
+static int ipcp_is_open; /* haven't called np_finished() */
static bool ask_for_local; /* request our address from peer */
static char vj_value[8]; /* string form of vj option value */
static char netmask_str[20]; /* string form of netmask value */
int unit;
{
fsm_open(&ipcp_fsm[unit]);
+ ipcp_is_open = 1;
}
* If they want to negotiate about IP addresses, we comply.
* If they want us to ask for compression, we refuse.
*/
- while (len > CILEN_VOID) {
+ while (len >= CILEN_VOID) {
GETCHAR(citype, p);
GETCHAR(cilen, p);
- if( (len -= cilen) < 0 )
+ if ( cilen < CILEN_VOID || (len -= cilen) < 0 )
goto bad;
next = p + cilen - 2;
ipcp_finished(f)
fsm *f;
{
- np_finished(f->unit, PPP_IP);
+ if (ipcp_is_open) {
+ ipcp_is_open = 0;
+ np_finished(f->unit, PPP_IP);
+ }
}