diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 01fab29..04f1a76 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -4460,6 +4460,12 @@ static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, goto out; } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)) + mon_ndev->min_mtu = WLAN_MIN_ETHFRM_LEN; + mon_ndev->mtu = WLAN_DATA_MAXLEN; + mon_ndev->max_mtu = WLAN_DATA_MAXLEN; +#endif + mon_ndev->type = ARPHRD_IEEE80211_RADIOTAP; strncpy(mon_ndev->name, name, IFNAMSIZ); mon_ndev->name[IFNAMSIZ - 1] = 0; diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index caf020d..bd7da8b 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1513,6 +1513,12 @@ struct net_device *rtw_init_netdev(_adapter *old_padapter) if (!pnetdev) return NULL; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)) + pnetdev->min_mtu = WLAN_MIN_ETHFRM_LEN; + pnetdev->mtu = WLAN_DATA_MAXLEN; + pnetdev->max_mtu = WLAN_DATA_MAXLEN; +#endif + padapter = rtw_netdev_priv(pnetdev); padapter->pnetdev = pnetdev; diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 82a37d2..1068f2d 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -2324,6 +2324,12 @@ struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv, void *old_p if (!pnetdev) goto RETURN; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)) + pnetdev->min_mtu = WLAN_MIN_ETHFRM_LEN; + pnetdev->mtu = WLAN_MAX_ETHFRM_LEN; + pnetdev->max_mtu = WLAN_DATA_MAXLEN; +#endif + pnpi = netdev_priv(pnetdev); pnpi->priv = old_priv; pnpi->sizeof_priv = sizeof_priv; @@ -2345,6 +2351,12 @@ struct net_device *rtw_alloc_etherdev(int sizeof_priv) if (!pnetdev) goto RETURN; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)) + pnetdev->min_mtu = WLAN_MIN_ETHFRM_LEN; + pnetdev->mtu = WLAN_MAX_ETHFRM_LEN; + pnetdev->max_mtu = WLAN_DATA_MAXLEN; +#endif + pnpi = netdev_priv(pnetdev); pnpi->priv = rtw_zvmalloc(sizeof_priv);