aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChaitanya <chaitanyatk@posedge.com>2012-12-21 06:45:17 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-01-03 07:00:01 -0500
commit09b1426e7fcec510aba55a761da5004e47a11ce3 (patch)
treede82b4ae0b9d0f10488dbe46bfdbc50fb5fc12e4
parent826262c3d23743cb032a9e1a65a0f9be75091a5e (diff)
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: T Krishna Chaitanya <chaitanyatk@posedge.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/iface.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 0f2a9f987f79..8be854e86cd9 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -207,17 +207,8 @@ void ieee80211_recalc_idle(struct ieee80211_local *local)
207 207
208static int ieee80211_change_mtu(struct net_device *dev, int new_mtu) 208static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
209{ 209{
210 int meshhdrlen; 210 if (new_mtu < 256 || new_mtu > IEEE80211_MAX_DATA_LEN)
211 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
212
213 meshhdrlen = (sdata->vif.type == NL80211_IFTYPE_MESH_POINT) ? 5 : 0;
214
215 /* FIX: what would be proper limits for MTU?
216 * This interface uses 802.3 frames. */
217 if (new_mtu < 256 ||
218 new_mtu > IEEE80211_MAX_DATA_LEN - 24 - 6 - meshhdrlen) {
219 return -EINVAL; 211 return -EINVAL;
220 }
221 212
222 dev->mtu = new_mtu; 213 dev->mtu = new_mtu;
223 return 0; 214 return 0;