net/tun: 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:
parent
500d8541fa
commit
e63e083a2f
|
@ -883,6 +883,7 @@ static int tun_ifup(FAR struct net_driver_s *dev)
|
|||
wd_start(&priv->txpoll, TUN_WDDELAY, tun_poll_expiry, (wdparm_t)priv);
|
||||
|
||||
priv->bifup = true;
|
||||
netdev_carrier_on(dev);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
@ -907,6 +908,8 @@ static int tun_ifdown(FAR struct net_driver_s *dev)
|
|||
FAR struct tun_device_s *priv = (FAR struct tun_device_s *)dev->d_private;
|
||||
irqstate_t flags;
|
||||
|
||||
netdev_carrier_off(dev);
|
||||
|
||||
flags = enter_critical_section();
|
||||
|
||||
/* Cancel the TX poll timer */
|
||||
|
|
Loading…
Reference in New Issue