diff --git a/src/include/netif/ppp/ppp_impl.h b/src/include/netif/ppp/ppp_impl.h index 35bba55a..c342778f 100644 --- a/src/include/netif/ppp/ppp_impl.h +++ b/src/include/netif/ppp/ppp_impl.h @@ -285,7 +285,6 @@ struct protent { */ /* Process a received data packet */ void (*datainput) (ppp_pcb *pcb, u_char *pkt, int len); - u8_t enabled_flag; /* 0 if protocol is disabled */ #if PRINTPKT_SUPPORT const char *name; /* Text name of protocol */ const char *data_name; /* Text name of corresponding data protocol */ diff --git a/src/netif/ppp/auth.c b/src/netif/ppp/auth.c index 5d4b928d..311d0f10 100644 --- a/src/netif/ppp/auth.c +++ b/src/netif/ppp/auth.c @@ -711,8 +711,6 @@ void upper_layers_down(ppp_pcb *pcb) { const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) { - if (!protp->enabled_flag) - continue; if (protp->protocol != PPP_LCP && protp->lowerdown != NULL) (*protp->lowerdown)(pcb); if (protp->protocol < 0xC000 && protp->close != NULL) @@ -744,7 +742,7 @@ void link_established(ppp_pcb *pcb) { */ if (!doing_multilink) { for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol != PPP_LCP && protp->enabled_flag + if (protp->protocol != PPP_LCP && protp->lowerup != NULL) (*protp->lowerup)(pcb); } @@ -946,7 +944,7 @@ void start_networks(ppp_pcb *pcb) { || protp->protocol == PPP_CCP #endif /* CCP_SUPPORT */ ) - && protp->enabled_flag && protp->open != NULL) + && protp->open != NULL) (*protp->open)(pcb); #endif /* CCP_SUPPORT || ECP_SUPPORT */ @@ -986,7 +984,7 @@ void continue_networks(ppp_pcb *pcb) { #if ECP_SUPPORT && protp->protocol != PPP_ECP #endif /* ECP_SUPPORT */ - && protp->enabled_flag && protp->open != NULL) { + && protp->open != NULL) { (*protp->open)(pcb); ++pcb->num_np_open; } diff --git a/src/netif/ppp/ccp.c b/src/netif/ppp/ccp.c index 0af35482..ff7e546c 100644 --- a/src/netif/ppp/ccp.c +++ b/src/netif/ppp/ccp.c @@ -193,7 +193,6 @@ const struct protent ccp_protent = { ccp_printpkt, #endif /* PRINTPKT_SUPPORT */ ccp_datainput, - 1, #if PRINTPKT_SUPPORT "CCP", "Compressed", diff --git a/src/netif/ppp/chap-new.c b/src/netif/ppp/chap-new.c index 8432dac2..4a4e910d 100644 --- a/src/netif/ppp/chap-new.c +++ b/src/netif/ppp/chap-new.c @@ -652,7 +652,6 @@ const struct protent chap_protent = { chap_print_pkt, #endif /* PRINTPKT_SUPPORT */ NULL, /* datainput */ - 1, /* enabled_flag */ #if PRINTPKT_SUPPORT "CHAP", /* name */ NULL, /* data_name */ diff --git a/src/netif/ppp/demand.c b/src/netif/ppp/demand.c index f31a124c..1cd9b614 100644 --- a/src/netif/ppp/demand.c +++ b/src/netif/ppp/demand.c @@ -111,7 +111,7 @@ demand_conf() * Call the demand_conf procedure for each protocol that's got one. */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->enabled_flag && protp->demand_conf != NULL) + if (protp->demand_conf != NULL) ((*protp->demand_conf)(pcb)); /* FIXME: find a way to die() here */ #if 0 @@ -131,7 +131,7 @@ demand_block() const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->enabled_flag && protp->demand_conf != NULL) + if (protp->demand_conf != NULL) sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_QUEUE); get_loop_output(); } @@ -148,7 +148,7 @@ demand_discard() const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->enabled_flag && protp->demand_conf != NULL) + if (protp->demand_conf != NULL) sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_ERROR); get_loop_output(); @@ -174,7 +174,7 @@ demand_unblock() const struct protent *protp; for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->enabled_flag && protp->demand_conf != NULL) + if (protp->demand_conf != NULL) sifnpmode(pcb, protp->protocol & ~0x8000, NPMODE_PASS); } @@ -454,8 +454,6 @@ active_packet(p, len) #endif for (i = 0; (protp = protocols[i]) != NULL; ++i) { if (protp->protocol < 0xC000 && (protp->protocol & ~0x8000) == proto) { - if (!protp->enabled_flag) - return 0; if (protp->active_pkt == NULL) return 1; return (*protp->active_pkt)(p, len); diff --git a/src/netif/ppp/eap.c b/src/netif/ppp/eap.c index 5016eac5..a118c76e 100644 --- a/src/netif/ppp/eap.c +++ b/src/netif/ppp/eap.c @@ -124,7 +124,6 @@ const struct protent eap_protent = { eap_printpkt, /* print a packet in readable form */ #endif /* PRINTPKT_SUPPORT */ NULL, /* process a received data packet */ - 1, /* protocol enabled */ #if PRINTPKT_SUPPORT "EAP", /* text name of protocol */ NULL, /* text name of corresponding data protocol */ diff --git a/src/netif/ppp/ecp.c b/src/netif/ppp/ecp.c index 728fb5fb..fcc97e08 100644 --- a/src/netif/ppp/ecp.c +++ b/src/netif/ppp/ecp.c @@ -112,7 +112,6 @@ const struct protent ecp_protent = { ecp_printpkt, #endif /* PRINTPKT_SUPPORT */ NULL, /* ecp_datainput, */ - 0, #if PRINTPKT_SUPPORT "ECP", "Encrypted", diff --git a/src/netif/ppp/ipcp.c b/src/netif/ppp/ipcp.c index 970e69e6..f22346cc 100644 --- a/src/netif/ppp/ipcp.c +++ b/src/netif/ppp/ipcp.c @@ -291,7 +291,6 @@ const struct protent ipcp_protent = { ipcp_printpkt, #endif /* PRINTPKT_SUPPORT */ NULL, - 1, #if PRINTPKT_SUPPORT "IPCP", "IP", diff --git a/src/netif/ppp/ipv6cp.c b/src/netif/ppp/ipv6cp.c index 5ff61835..72470670 100644 --- a/src/netif/ppp/ipv6cp.c +++ b/src/netif/ppp/ipv6cp.c @@ -284,7 +284,6 @@ const struct protent ipv6cp_protent = { ipv6cp_printpkt, #endif /* PRINTPKT_SUPPORT */ NULL, - 1, #if PRINTPKT_SUPPORT "IPV6CP", "IPV6", diff --git a/src/netif/ppp/lcp.c b/src/netif/ppp/lcp.c index 12fc0b65..042729c9 100644 --- a/src/netif/ppp/lcp.c +++ b/src/netif/ppp/lcp.c @@ -285,7 +285,6 @@ const struct protent lcp_protent = { lcp_printpkt, #endif /* PRINTPKT_SUPPORT */ NULL, - 1, #if PRINTPKT_SUPPORT "LCP", NULL, @@ -586,7 +585,7 @@ static void lcp_rprotrej(fsm *f, u_char *inp, int len) { * Upcall the proper Protocol-Reject routine. */ for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol == prot && protp->enabled_flag) { + if (protp->protocol == prot) { #if PPP_PROTOCOLNAME if (pname != NULL) ppp_dbglog("Protocol-Reject for '%s' (0x%x) received", pname, diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index e03f9d52..1328d416 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -743,7 +743,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) { * Upcall the proper protocol input routine. */ for (i = 0; (protp = protocols[i]) != NULL; ++i) { - if (protp->protocol == protocol && protp->enabled_flag) { + if (protp->protocol == protocol) { pb = ppp_singlebuf(pb); (*protp->input)(pcb, (u_char*)pb->payload, pb->len); goto out; @@ -757,7 +757,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) { * This is only used by CCP, which we cannot support until we have a CCP data * implementation. */ - if (protocol == (protp->protocol & ~0x8000) && protp->enabled_flag + if (protocol == (protp->protocol & ~0x8000) && protp->datainput != NULL) { (*protp->datainput)(pcb, pb->payload, pb->len); goto out; diff --git a/src/netif/ppp/upap.c b/src/netif/ppp/upap.c index 14f80b6d..efb6fc30 100644 --- a/src/netif/ppp/upap.c +++ b/src/netif/ppp/upap.c @@ -102,7 +102,6 @@ const struct protent pap_protent = { upap_printpkt, #endif /* PRINTPKT_SUPPORT */ NULL, - 1, #if PRINTPKT_SUPPORT "PAP", NULL,