diff --git a/src/include/netif/ppp/ppp_impl.h b/src/include/netif/ppp/ppp_impl.h index d8c1f419..56a29a54 100644 --- a/src/include/netif/ppp/ppp_impl.h +++ b/src/include/netif/ppp/ppp_impl.h @@ -450,8 +450,8 @@ int sif6down (ppp_pcb *pcb); int sifnpmode(ppp_pcb *pcb, int proto, enum NPmode mode); #endif /* DEMAND_SUPPORt */ -void netif_set_mtu(ppp_pcb *pcb, int mtu); -int netif_get_mtu(ppp_pcb *pcb); +void ppp_netif_set_mtu(ppp_pcb *pcb, int mtu); +int ppp_netif_get_mtu(ppp_pcb *pcb); #if CCP_SUPPORT #if 0 /* unused */ diff --git a/src/netif/ppp/ccp.c b/src/netif/ppp/ccp.c index 6c2dadc9..86ecb9fb 100644 --- a/src/netif/ppp/ccp.c +++ b/src/netif/ppp/ccp.c @@ -1213,9 +1213,9 @@ static int ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak) { * because MPPE frames **grow**. The kernel [must] * allocate MPPE_PAD extra bytes in xmit buffers. */ - mtu = netif_get_mtu(pcb); + mtu = ppp_netif_get_mtu(pcb); if (mtu) - netif_set_mtu(pcb, mtu - MPPE_PAD); + ppp_netif_set_mtu(pcb, mtu - MPPE_PAD); else newret = CONFREJ; } diff --git a/src/netif/ppp/demand.c b/src/netif/ppp/demand.c index 26c6c30d..872fe4d5 100644 --- a/src/netif/ppp/demand.c +++ b/src/netif/ppp/demand.c @@ -98,7 +98,7 @@ demand_conf() flush_flag = 0; fcs = PPP_INITFCS; - netif_set_mtu(pcb, LWIP_MIN(lcp_allowoptions[0].mru, PPP_MRU)); + ppp_netif_set_mtu(pcb, LWIP_MIN(lcp_allowoptions[0].mru, PPP_MRU)); if (ppp_send_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0 || ppp_recv_config(pcb, PPP_MRU, (u32_t) 0, 0, 0) < 0) fatal("Couldn't set up demand-dialled PPP interface: %m"); diff --git a/src/netif/ppp/lcp.c b/src/netif/ppp/lcp.c index bdd54516..f6dd4582 100644 --- a/src/netif/ppp/lcp.c +++ b/src/netif/ppp/lcp.c @@ -2314,7 +2314,7 @@ static void lcp_up(fsm *f) { #ifdef HAVE_MULTILINK if (!(multilink && go->neg_mrru && ho->neg_mrru)) #endif /* HAVE_MULTILINK */ - netif_set_mtu(pcb, LWIP_MIN(LWIP_MIN(mtu, mru), ao->mru)); + ppp_netif_set_mtu(pcb, LWIP_MIN(LWIP_MIN(mtu, mru), ao->mru)); ppp_send_config(pcb, mtu, (ho->neg_asyncmap? ho->asyncmap: 0xffffffff), ho->neg_pcompression, ho->neg_accompression); diff --git a/src/netif/ppp/multilink.c b/src/netif/ppp/multilink.c index 62014e8c..31df7642 100644 --- a/src/netif/ppp/multilink.c +++ b/src/netif/ppp/multilink.c @@ -148,12 +148,12 @@ mp_join_bundle() if (demand) { /* already have a bundle */ cfg_bundle(0, 0, 0, 0); - netif_set_mtu(pcb, mtu); + ppp_netif_set_mtu(pcb, mtu); return 0; } make_new_bundle(0, 0, 0, 0); set_ifunit(1); - netif_set_mtu(pcb, mtu); + ppp_netif_set_mtu(pcb, mtu); return 0; } @@ -198,7 +198,7 @@ mp_join_bundle() mtu = LWIP_MIN(ho->mrru, ao->mru); if (demand) { cfg_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); - netif_set_mtu(pcb, mtu); + ppp_netif_set_mtu(pcb, mtu); script_setenv("BUNDLE", bundle_id + 7, 1); return 0; } @@ -245,7 +245,7 @@ mp_join_bundle() /* we have to make a new bundle */ make_new_bundle(go->mrru, ho->mrru, go->neg_ssnhf, ho->neg_ssnhf); set_ifunit(1); - netif_set_mtu(pcb, mtu); + ppp_netif_set_mtu(pcb, mtu); script_setenv("BUNDLE", bundle_id + 7, 1); make_bundle_links(pcb); unlock_db(); diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index 4e7667e1..56b4f724 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -1031,13 +1031,13 @@ void new_phase(ppp_pcb *pcb, int p) { */ int ppp_send_config(ppp_pcb *pcb, int mtu, u32_t accm, int pcomp, int accomp) { LWIP_UNUSED_ARG(mtu); - /* pcb->mtu = mtu; -- set correctly with netif_set_mtu */ + + PPPDEBUG(LOG_INFO, ("ppp_send_config[%d]\n", pcb->netif->num)); if (pcb->link_cb->send_config) { pcb->link_cb->send_config(pcb, pcb->link_ctx_cb, accm, pcomp, accomp); } - PPPDEBUG(LOG_INFO, ("ppp_send_config[%d]\n", pcb->netif->num) ); return 0; } @@ -1048,11 +1048,12 @@ int ppp_send_config(ppp_pcb *pcb, int mtu, u32_t accm, int pcomp, int accomp) { int ppp_recv_config(ppp_pcb *pcb, int mru, u32_t accm, int pcomp, int accomp) { LWIP_UNUSED_ARG(mru); + PPPDEBUG(LOG_INFO, ("ppp_recv_config[%d]\n", pcb->netif->num)); + if (pcb->link_cb->recv_config) { pcb->link_cb->recv_config(pcb, pcb->link_ctx_cb, accm, pcomp, accomp); } - PPPDEBUG(LOG_INFO, ("ppp_recv_config[%d]\n", pcb->netif->num)); return 0; } @@ -1317,18 +1318,18 @@ int sifnpmode(ppp_pcb *pcb, int proto, enum NPmode mode) { #endif /* DEMAND_SUPPORT */ /* - * netif_set_mtu - set the MTU on the PPP network interface. + * ppp_netif_set_mtu - set the MTU on the PPP network interface. */ -void netif_set_mtu(ppp_pcb *pcb, int mtu) { +void ppp_netif_set_mtu(ppp_pcb *pcb, int mtu) { pcb->netif->mtu = mtu; - PPPDEBUG(LOG_INFO, ("netif_set_mtu[%d]: mtu=%d\n", pcb->netif->num, mtu)); + PPPDEBUG(LOG_INFO, ("ppp_netif_set_mtu[%d]: mtu=%d\n", pcb->netif->num, mtu)); } /* - * netif_get_mtu - get PPP interface MTU + * ppp_netif_get_mtu - get PPP interface MTU */ -int netif_get_mtu(ppp_pcb *pcb) { +int ppp_netif_get_mtu(ppp_pcb *pcb) { return pcb->netif->mtu; }