From 1c8945ba9264bf52fcfd59e60f671cce7f96149c Mon Sep 17 00:00:00 2001 From: Tuomo Untinen Date: Thu, 19 Sep 2019 08:50:13 +0300 Subject: [PATCH] Adds definite sizes for MTUs. This will add minimum mtu size, default and maximum mtu sizes. For monitor interface and netdevice default MTU will be set to WLAN_DATA_MAXLEN. For ethernet devices default MTU size will be WLAN_MAX_ETHFRM_LEN. --- include/rtw_version.h | 2 +- os_dep/linux/ioctl_cfg80211.c | 3 +++ os_dep/linux/os_intfs.c | 4 ++++ os_dep/osdep_service.c | 8 ++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/rtw_version.h b/include/rtw_version.h index 1780abe..8c35ee9 100644 --- a/include/rtw_version.h +++ b/include/rtw_version.h @@ -1 +1 @@ -#define DRIVERVERSION "v5.2.20.2_28373.20180619" +#define DRIVERVERSION "v5.2.20.2_28373.20190919" diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 36c278a..4e108fe 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -4165,6 +4165,9 @@ static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct ne ret = -ENOMEM; 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); diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index f75ca82..f0fe633 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1477,6 +1477,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 6949fba..d333b1f 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -2059,6 +2059,10 @@ 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; @@ -2080,6 +2084,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);