diff --git a/osdep_service.c b/osdep_service.c index de76d75..c9245f1 100644 --- a/osdep_service.c +++ b/osdep_service.c @@ -1367,7 +1367,11 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname) rtw_init_netdev_name(pnetdev, ifname); - memcpy((void *)pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) + memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN); +#else + dev_addr_set(pnetdev, adapter_mac_addr(padapter)); +#endif if (rtnl_lock_needed) ret = register_netdev(pnetdev);