From 4e69a2756d2f2cacda12a4bda9c8594214d3340c Mon Sep 17 00:00:00 2001 From: astsam Date: Thu, 23 Mar 2017 21:04:32 +0300 Subject: [PATCH] Fix interface rename error --- os_dep/linux/os_intfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 68285c0..4028549 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1109,6 +1109,7 @@ static int rtw_ndev_notifier_call(struct notifier_block *nb, unsigned long state #else struct net_device *dev = ptr; #endif + _adapter *adapter = rtw_netdev_priv(dev); if (dev == NULL) return NOTIFY_DONE; @@ -1134,6 +1135,8 @@ static int rtw_ndev_notifier_call(struct notifier_block *nb, unsigned long state switch (state) { case NETDEV_CHANGENAME: rtw_adapter_proc_replace(dev); + strncpy(adapter->old_ifname, dev->name, IFNAMSIZ); + adapter->old_ifname[IFNAMSIZ-1] = 0; break; }