mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-03 21:32:08 +00:00
PPP, removed unnecessary memset()
Everything is cleared in ppp_clear(), we don't need to clear all structures twice.
This commit is contained in:
parent
40c671b1a5
commit
1b6d6d0dc0
@ -368,20 +368,19 @@ setdeflate(argv)
|
||||
static void ccp_init(ppp_pcb *pcb) {
|
||||
fsm *f = &pcb->ccp_fsm;
|
||||
ccp_options *wo = &pcb->ccp_wantoptions;
|
||||
ccp_options *go = &pcb->ccp_gotoptions;
|
||||
ccp_options *ao = &pcb->ccp_allowoptions;
|
||||
ccp_options *ho = &pcb->ccp_hisoptions;
|
||||
|
||||
f->pcb = pcb;
|
||||
f->protocol = PPP_CCP;
|
||||
f->callbacks = &ccp_callbacks;
|
||||
fsm_init(f);
|
||||
|
||||
/* FIXME: useless, everything is cleared in ppp_clear() */
|
||||
#if 0 /* Not necessary, everything is cleared in ppp_clear() */
|
||||
memset(wo, 0, sizeof(*wo));
|
||||
memset(go, 0, sizeof(*go));
|
||||
memset(ao, 0, sizeof(*ao));
|
||||
memset(ho, 0, sizeof(*ho));
|
||||
#endif /* 0 */
|
||||
|
||||
#if DEFLATE_SUPPORT
|
||||
wo->deflate = 1;
|
||||
|
@ -122,11 +122,14 @@ static const struct chap_digest_type* const chap_digests[] = {
|
||||
* chap_init - reset to initial state.
|
||||
*/
|
||||
static void chap_init(ppp_pcb *pcb) {
|
||||
LWIP_UNUSED_ARG(pcb);
|
||||
|
||||
#if 0 /* Not necessary, everything is cleared in ppp_clear() */
|
||||
memset(&pcb->chap_client, 0, sizeof(chap_client_state));
|
||||
#if PPP_SERVER
|
||||
memset(&pcb->chap_server, 0, sizeof(chap_server_state));
|
||||
#endif /* PPP_SERVER */
|
||||
#endif /* 0 */
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -166,10 +166,12 @@ ecp_init(unit)
|
||||
f->callbacks = &ecp_callbacks;
|
||||
fsm_init(f);
|
||||
|
||||
#if 0 /* Not necessary, everything is cleared in ppp_clear() */
|
||||
memset(&ecp_wantoptions[unit], 0, sizeof(ecp_options));
|
||||
memset(&ecp_gotoptions[unit], 0, sizeof(ecp_options));
|
||||
memset(&ecp_allowoptions[unit], 0, sizeof(ecp_options));
|
||||
memset(&ecp_hisoptions[unit], 0, sizeof(ecp_options));
|
||||
#endif /* 0 */
|
||||
|
||||
}
|
||||
|
||||
|
@ -611,8 +611,10 @@ static void ipcp_init(ppp_pcb *pcb) {
|
||||
*/
|
||||
f->maxnakloops = 100;
|
||||
|
||||
#if 0 /* Not necessary, everything is cleared in ppp_clear() */
|
||||
memset(wo, 0, sizeof(*wo));
|
||||
memset(ao, 0, sizeof(*ao));
|
||||
#endif /* 0 */
|
||||
|
||||
wo->neg_addr = wo->old_addrs = 1;
|
||||
#if VJ_SUPPORT
|
||||
|
@ -435,8 +435,10 @@ static void ipv6cp_init(ppp_pcb *pcb) {
|
||||
f->callbacks = &ipv6cp_callbacks;
|
||||
fsm_init(f);
|
||||
|
||||
#if 0 /* Not necessary, everything is cleared in ppp_clear() */
|
||||
memset(wo, 0, sizeof(*wo));
|
||||
memset(ao, 0, sizeof(*ao));
|
||||
#endif /* 0 */
|
||||
|
||||
wo->accept_local = 1;
|
||||
wo->neg_ifaceid = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user