- for (i = 0; (protp = protocols[i]) != NULL; ++i)
- if (protp->protocol < 0xC000 && protp->enabled_flag
- && protp->open != NULL) {
- (*protp->open)(0);
- if (protp->protocol != PPP_CCP)
+ /* Start CCP and ECP */
+ for (i = 0; (protp = protocols[i]) != NULL; ++i)
+ if ((protp->protocol == PPP_ECP || protp->protocol == PPP_CCP)
+ && protp->enabled_flag && protp->open != NULL)
+ (*protp->open)(0);
+ }
+
+ /*
+ * Bring up other network protocols after encryption has completed.
+ * OPENED here merely means that negotiation has completed. It is
+ * up to the protocol to correctly terminate or disable LCP/NCP
+ * based on the result of the negotiation.
+ */
+ ecp_required = ecp_gotoptions[unit].required;
+ mppe_required = ccp_gotoptions[unit].mppe;
+ if ((!ecp_required && !mppe_required)
+ || (ecp_required && ecp_fsm[unit].state == OPENED)
+ || (mppe_required && ccp_fsm[unit].state == OPENED)) {
+ for (i = 0; (protp = protocols[i]) != NULL; ++i)
+ if (protp->protocol < 0xC000
+ && protp->protocol != PPP_CCP && protp->protocol != PPP_ECP
+ && protp->enabled_flag && protp->open != NULL) {
+ (*protp->open)(0);