PPP: use netif_set_up() instead of setting NETIF_FLAG_UP flag

NETIF_FLAG_UP flag is not supposed to be set by netif init callback
anymore, call netif_set_up() instead.

Sure it would be better to let user application code call netif_set_up()
by itself as it is now meant to be but let's not break compatibility for
now and add a FIXME for next release with allowed behavior break.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
This commit is contained in:
Sylvain Rochet 2020-04-09 03:32:05 +02:00
parent cfe5ce9d49
commit c8fda8d46c

View File

@ -473,7 +473,6 @@ static err_t ppp_netif_init_cb(struct netif *netif) {
#if PPP_IPV6_SUPPORT #if PPP_IPV6_SUPPORT
netif->output_ip6 = ppp_netif_output_ip6; netif->output_ip6 = ppp_netif_output_ip6;
#endif /* PPP_IPV6_SUPPORT */ #endif /* PPP_IPV6_SUPPORT */
netif->flags = NETIF_FLAG_UP;
#if LWIP_NETIF_HOSTNAME #if LWIP_NETIF_HOSTNAME
/* @todo: Initialize interface hostname */ /* @todo: Initialize interface hostname */
/* netif_set_hostname(netif, "lwip"); */ /* netif_set_hostname(netif, "lwip"); */
@ -707,6 +706,7 @@ ppp_pcb *ppp_new(struct netif *pppif, const struct link_callbacks *callbacks, vo
PPPDEBUG(LOG_ERR, ("ppp_new: netif_add failed\n")); PPPDEBUG(LOG_ERR, ("ppp_new: netif_add failed\n"));
return NULL; return NULL;
} }
netif_set_up(pcb->netif);
pcb->link_cb = callbacks; pcb->link_cb = callbacks;
pcb->link_ctx_cb = link_ctx_cb; pcb->link_ctx_cb = link_ctx_cb;