From a92167dc8b22e9da5c25f1872d31afe8ac6bf360 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Mon, 11 Nov 2019 01:08:21 +0100 Subject: [PATCH] Adds definite sizes for MTUs --- os_dep/linux/ioctl_cfg80211.c | 4 ++++ os_dep/linux/os_intfs.c | 4 ++++ os_dep/osdep_service.c | 11 +++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index fab891e..65c8c65 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -4655,6 +4655,10 @@ static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct ne goto out; } + mon_ndev->min_mtu = WLAN_MIN_ETHFRM_LEN; + mon_ndev->mtu = WLAN_DATA_MAXLEN; + mon_ndev->max_mtu = WLAN_DATA_MAXLEN; + 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 98e5863..ae8df8e 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1592,6 +1592,10 @@ struct net_device *rtw_init_netdev(_adapter *old_padapter) if (!pnetdev) return NULL; + pnetdev->min_mtu = WLAN_MIN_ETHFRM_LEN; + pnetdev->mtu = WLAN_DATA_MAXLEN; + pnetdev->max_mtu = WLAN_DATA_MAXLEN; + padapter = rtw_netdev_priv(pnetdev); padapter->pnetdev = pnetdev; diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 35013ed..7612e20 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -13,7 +13,6 @@ * *****************************************************************************/ - #define _OSDEP_SERVICE_C_ #include @@ -27,7 +26,6 @@ atomic_t _malloc_size = ATOMIC_INIT(0); #endif #endif /* DBG_MEMORY_LEAK */ - #if defined(PLATFORM_LINUX) /* * Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE @@ -2390,6 +2388,11 @@ struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv, void *old_p if (!pnetdev) goto RETURN; + + pnetdev->min_mtu = WLAN_MIN_ETHFRM_LEN; + pnetdev->mtu = WLAN_MAX_ETHFRM_LEN; + pnetdev->max_mtu = WLAN_DATA_MAXLEN; + pnpi = netdev_priv(pnetdev); pnpi->priv = old_priv; pnpi->sizeof_priv = sizeof_priv; @@ -2411,6 +2414,10 @@ struct net_device *rtw_alloc_etherdev(int sizeof_priv) if (!pnetdev) goto RETURN; + pnetdev->min_mtu = WLAN_MIN_ETHFRM_LEN; + pnetdev->mtu = WLAN_MAX_ETHFRM_LEN; + pnetdev->max_mtu = WLAN_DATA_MAXLEN; + pnpi = netdev_priv(pnetdev); pnpi->priv = rtw_zvmalloc(sizeof_priv);