From 86774df023cae73ffb315a21150bff7806ae66ec Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 17 Jul 2001 19:12:02 +0000 Subject: [PATCH] Fix a slight bug introduced with revision 1.9 (IPv6 integration) where the bit mask of open NCPs got out of sync. Defer the (potential) closing of LCP after a NCP went down until after the state machines got updated. This fixes PR kern/11161. --- sys/net/if_spppsubr.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index ad935cabc680..2ead689b2eff 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_spppsubr.c,v 1.23 2001/04/13 23:30:15 thorpej Exp $ */ +/* $NetBSD: if_spppsubr.c,v 1.24 2001/07/17 19:12:02 martin Exp $ */ /* * Synchronous PPP/Cisco link level subroutines. @@ -1604,10 +1604,12 @@ sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m) case STATE_CLOSING: (cp->tlf)(sp); sppp_cp_change_state(cp, sp, STATE_CLOSED); + sppp_lcp_check_and_close(sp); break; case STATE_STOPPING: (cp->tlf)(sp); sppp_cp_change_state(cp, sp, STATE_STOPPED); + sppp_lcp_check_and_close(sp); break; case STATE_ACK_RCVD: sppp_cp_change_state(cp, sp, STATE_REQ_SENT); @@ -1944,16 +1946,19 @@ sppp_to_event(const struct cp *cp, struct sppp *sp) case STATE_CLOSING: (cp->tlf)(sp); sppp_cp_change_state(cp, sp, STATE_CLOSED); + sppp_lcp_check_and_close(sp); break; case STATE_STOPPING: (cp->tlf)(sp); sppp_cp_change_state(cp, sp, STATE_STOPPED); + sppp_lcp_check_and_close(sp); break; case STATE_REQ_SENT: case STATE_ACK_RCVD: case STATE_ACK_SENT: (cp->tlf)(sp); sppp_cp_change_state(cp, sp, STATE_STOPPED); + sppp_lcp_check_and_close(sp); break; } else @@ -3145,12 +3150,8 @@ sppp_ipcp_tls(struct sppp *sp) static void sppp_ipcp_tlf(struct sppp *sp) { - -#if 0 /* need #if 0 to close IPCP properly */ /* we no longer need LCP */ sp->lcp.protos &= ~(1 << IDX_IPCP); - sppp_lcp_check_and_close(sp); -#endif } static void @@ -3594,12 +3595,8 @@ sppp_ipv6cp_tls(struct sppp *sp) static void sppp_ipv6cp_tlf(struct sppp *sp) { - -#if 0 /* need #if 0 to close IPv6CP properly */ /* we no longer need LCP */ sp->lcp.protos &= ~(1 << IDX_IPV6CP); - sppp_lcp_check_and_close(sp); -#endif } static void