diff mbox series

wwan: core: Fix missing RTM_NEWLINK event

Message ID 1626968964-17249-1-git-send-email-loic.poulain@linaro.org
State New
Headers show
Series wwan: core: Fix missing RTM_NEWLINK event | expand

Commit Message

Loic Poulain July 22, 2021, 3:49 p.m. UTC
By default there is no rtnetlink event generated when registering a
netdev with rtnl_link_ops until its rtnl_link_state is switched to
initialized (RTNL_LINK_INITIALIZED). This causes issues with user
tools like NetworkManager which relies on such event to manage links.

Fix that by setting link to initialized (via rtnl_configure_link).

Cc: stable@vger.kernel.org
Fixes: 88b710532e53 ("wwan: add interface creation support")
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
 drivers/net/wwan/wwan_core.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c
index 3e16c31..409caf4 100644
--- a/drivers/net/wwan/wwan_core.c
+++ b/drivers/net/wwan/wwan_core.c
@@ -866,6 +866,10 @@  static int wwan_rtnl_newlink(struct net *src_net, struct net_device *dev,
 	else
 		ret = register_netdevice(dev);
 
+	/* Link initialized, notify new link */
+	if (!ret)
+		rtnl_configure_link(dev, NULL);
+
 out:
 	/* release the reference */
 	put_device(&wwandev->dev);