net/loopback: Update IFF_RUNNING flag by netdev_carrier_on and netdev_carrier_off

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2021-12-21 16:29:22 +08:00 committed by Gustavo Henrique Nihei
parent b03886415f
commit 500d8541fa

View File

@ -306,6 +306,7 @@ static int lo_ifup(FAR struct net_driver_s *dev)
lo_poll_expiry, (wdparm_t)priv);
priv->lo_bifup = true;
netdev_carrier_on(dev);
return OK;
}
@ -329,6 +330,8 @@ static int lo_ifdown(FAR struct net_driver_s *dev)
{
FAR struct lo_driver_s *priv = (FAR struct lo_driver_s *)dev->d_private;
netdev_carrier_off(dev);
/* Cancel the TX poll timer and TX timeout timers */
wd_cancel(&priv->lo_polldog);