[PATCH] wwan: core: Fix missing RTM_NEWLINK event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
Fixes: 88b710532e53 ("wwan: add interface creation support")
Signed-off-by: Loic Poulain <loic.poulain@xxxxxxxxxx>
---
 drivers/net/wwan/wwan_core.c | 4 ++++
 1 file changed, 4 insertions(+)

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);
-- 
2.7.4




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux