Commit 09b1426e authored by Chaitanya's avatar Chaitanya Committed by Johannes Berg

mac80211: fix maximum MTU

The maximum MTU shouldn't take the headers into account,
the maximum MSDU size is exactly the maximum MTU.
Signed-off-by: default avatarT Krishna Chaitanya <chaitanyatk@posedge.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 826262c3
...@@ -207,17 +207,8 @@ void ieee80211_recalc_idle(struct ieee80211_local *local) ...@@ -207,17 +207,8 @@ void ieee80211_recalc_idle(struct ieee80211_local *local)
static int ieee80211_change_mtu(struct net_device *dev, int new_mtu) static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
{ {
int meshhdrlen; if (new_mtu < 256 || new_mtu > IEEE80211_MAX_DATA_LEN)
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
meshhdrlen = (sdata->vif.type == NL80211_IFTYPE_MESH_POINT) ? 5 : 0;
/* FIX: what would be proper limits for MTU?
* This interface uses 802.3 frames. */
if (new_mtu < 256 ||
new_mtu > IEEE80211_MAX_DATA_LEN - 24 - 6 - meshhdrlen) {
return -EINVAL; return -EINVAL;
}
dev->mtu = new_mtu; dev->mtu = new_mtu;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment