From 89434f6a2f9cd36e3b78525822485d09a0b6b77a Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Thu, 5 Mar 2015 22:00:11 +0100 Subject: [PATCH] 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. --- src/netif/ppp/ppp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index 837b9eb1..62451ba1 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -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 */ ) {