mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-05 08:28:32 +00:00
PPP, CORE, call netif_set_up() after if4_up and if6_up flags are set, to prevent dropping packets
lwIP core might send packet when calling netif_set_up(), don't drop packets anymore in ppp_netif_output_ip4() and ppp_netif_output_ip6() because flags are cleared.
This commit is contained in:
parent
4e520cdd30
commit
89434f6a2f
@ -955,9 +955,9 @@ int sifup(ppp_pcb *pcb) {
|
||||
netif_set_addr(pcb->netif, &pcb->addrs.our_ipaddr, &pcb->addrs.netmask,
|
||||
&pcb->addrs.his_ipaddr);
|
||||
|
||||
netif_set_up(pcb->netif);
|
||||
pcb->if4_up = 1;
|
||||
pcb->err_code = PPPERR_NONE;
|
||||
netif_set_up(pcb->netif);
|
||||
|
||||
PPPDEBUG(LOG_DEBUG, ("sifup: unit %d: err_code=%d\n", pcb->netif->num, pcb->err_code));
|
||||
pcb->link_status_cb(pcb, pcb->err_code, pcb->ctx_cb);
|
||||
@ -1027,9 +1027,9 @@ int sif6up(ppp_pcb *pcb) {
|
||||
ip6_addr_copy(pcb->netif->ip6_addr[0], pcb->addrs.our6_ipaddr);
|
||||
netif_ip6_addr_set_state(pcb->netif, 0, IP6_ADDR_PREFERRED);
|
||||
|
||||
netif_set_up(pcb->netif);
|
||||
pcb->if6_up = 1;
|
||||
pcb->err_code = PPPERR_NONE;
|
||||
netif_set_up(pcb->netif);
|
||||
|
||||
PPPDEBUG(LOG_DEBUG, ("sif6up: unit %d: err_code=%d\n", pcb->netif->num, pcb->err_code));
|
||||
pcb->link_status_cb(pcb, pcb->err_code, pcb->ctx_cb);
|
||||
@ -1044,10 +1044,10 @@ int sif6up(ppp_pcb *pcb) {
|
||||
int sif6down(ppp_pcb *pcb) {
|
||||
|
||||
pcb->if6_up = 0;
|
||||
/* set the interface down if IPv4 is down as well */
|
||||
|
||||
if (1
|
||||
#if PPP_IPV4_SUPPORT
|
||||
/* set the interface down if IPv6 is down as well */
|
||||
/* set the interface down if IPv4 is down as well */
|
||||
&& !pcb->if4_up
|
||||
#endif /* PPP_IPV4_SUPPORT */
|
||||
) {
|
||||
|
Loading…
Reference in New Issue
Block a user