From a08496674fbd658fd97f0982fbd991802d8bec1f 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 7c6648b..c5bc146 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -847,6 +847,7 @@ static int rtw_ndev_notifier_call(struct notifier_block * nb, unsigned long stat #else struct net_device *dev = ptr; #endif + _adapter *adapter = rtw_netdev_priv(dev); #if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29)) if (dev->netdev_ops->ndo_do_ioctl != rtw_ioctl) @@ -860,6 +861,8 @@ static int rtw_ndev_notifier_call(struct notifier_block * nb, unsigned long stat switch (state) { case NETDEV_CHANGENAME: rtw_adapter_proc_replace(dev); + strncpy(adapter->old_ifname, dev->name, IFNAMSIZ); + adapter->old_ifname[IFNAMSIZ-1] = 0; break; }