PPP: set mtu6 too when setting PPP netif MTU

PPP peer can negotiate its MRU, therefore we don't know the MTU we are
going to use before starting PPP. This is an issue because netif_add
function assume that the netif init callback function will set the MTU,
netif_add will then copy mtu to mtu6. We have then to update mtu6 each
time we update mtu to keep them in sync. Doing so is fine because PPP
netif MTU is only updated when the netif is in link down state.
This commit is contained in:
Sylvain Rochet 2020-10-20 02:53:46 +02:00
parent a39ce0f53b
commit e801307738

View File

@ -1323,6 +1323,9 @@ int sifnpmode(ppp_pcb *pcb, int proto, enum NPmode mode) {
void ppp_netif_set_mtu(ppp_pcb *pcb, int mtu) { void ppp_netif_set_mtu(ppp_pcb *pcb, int mtu) {
pcb->netif->mtu = mtu; pcb->netif->mtu = mtu;
#if PPP_IPV6_SUPPORT && LWIP_ND6_ALLOW_RA_UPDATES
pcb->netif->mtu6 = mtu;
#endif /* PPP_IPV6_SUPPORT && LWIP_ND6_ALLOW_RA_UPDATES */
PPPDEBUG(LOG_INFO, ("ppp_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));
} }