From 500d8541faa4f6adb0520455010cbd41f7f33a2d Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 21 Dec 2021 16:29:22 +0800 Subject: [PATCH] net/loopback: Update IFF_RUNNING flag by netdev_carrier_on and netdev_carrier_off Signed-off-by: Xiang Xiao --- drivers/net/loopback.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 837c3246e5..4a839431e1 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c @@ -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);