Skip to contentSkip to conversation

net/tun: Call notifiers before and after changing device type

PATCH New Martin Schiller 1 participant 1 message Nov 16, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/tun: Call notifiers before and after changing device type

---
 drivers/net/tun.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/tun.c +2 -0
index be69d272052f..8253c5b03105 100644
@@ -3124,9 +3124,11 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
 				   "Linktype set failed because interface is up\n");
 			ret = -EBUSY;
 		} else {
+			call_netdevice_notifiers(NETDEV_PRE_TYPE_CHANGE, tun->dev);
 			tun->dev->type = (int) arg;
 			netif_info(tun, drv, tun->dev, "linktype set to %d\n",
 				   tun->dev->type);
+			call_netdevice_notifiers(NETDEV_POST_TYPE_CHANGE, tun->dev);
 			ret = 0;
 		}
 		break;
Signature · 1 line
2.20.1