[OpenWrt-Devel,1/3] kernel: trelay: handle netdevice events correctly
diff mbox series

Message ID 20190925144713.10632-1-alimjalnasrawy@gmail.com
State Accepted
Delegated to: Hauke Mehrtens
Headers show
Series
  • [OpenWrt-Devel,1/3] kernel: trelay: handle netdevice events correctly
Related show

Commit Message

Ali MJ Al-Nasrawy Sept. 25, 2019, 2:47 p.m. UTC
Since v3.11, netdevice notification data are of type
"struct netdev_notifier_info". Handle it as such!

This should fix a critical bug in which devices are unable get released
because trelay does not release resources in response to UNREGISTER
event spamming the log with something like:

unregister_netdevice: waiting for eth0.1 to become free. Usage count = 1

Signed-off-by: Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com>
---
 package/kernel/trelay/src/trelay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/package/kernel/trelay/src/trelay.c b/package/kernel/trelay/src/trelay.c
index 581a5cfd2f..6d9d9cc14b 100644
--- a/package/kernel/trelay/src/trelay.c
+++ b/package/kernel/trelay/src/trelay.c
@@ -86,7 +86,7 @@  static struct trelay *trelay_find(struct net_device *dev)
 static int tr_device_event(struct notifier_block *unused, unsigned long event,
 			   void *ptr)
 {
-	struct net_device *dev = ptr;
+	struct net_device *dev = ((struct netdev_notifier_info *)ptr)->dev;
 	struct trelay *tr;
 
 	if (event != NETDEV_UNREGISTER)