Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jan 2004 21:31:59 -0800 (PST)
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 45108 for review
Message-ID:  <200401110531.i0B5Vxgp066335@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=45108

Change 45108 by sam@sam_ebb on 2004/01/10 21:31:47

	correct bounds checking of 802.11 mtu

Affected files ...

.. //depot/projects/netperf+sockets/sys/net80211/ieee80211.h#4 edit
.. //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.c#6 edit

Differences ...

==== //depot/projects/netperf+sockets/sys/net80211/ieee80211.h#4 (text+ko) ====

@@ -427,7 +427,16 @@
 
 #define	IEEE80211_CRC_LEN			4
 
-#define	IEEE80211_MTU				1500
+/*
+ * Maximum acceptable MTU is:
+ *	IEEE80211_MAX_LEN - WEP overhead - CRC -
+ *		QoS overhead - RSN/WPA overhead
+ * Min is arbitrarily chosen > IEEE80211_MIN_LEN.  The default
+ * mtu is Ethernet-compatible; it's set by ether_ifattach.
+ */
+#define	IEEE80211_MTU_MAX			2290
+#define	IEEE80211_MTU_MIN			32
+
 #define	IEEE80211_MAX_LEN			(2300 + IEEE80211_CRC_LEN + \
     (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN))
 #define	IEEE80211_MIN_LEN \

==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.c#6 (text+ko) ====

@@ -1098,7 +1098,8 @@
 		break;
 	case SIOCSIFMTU:
 		ifr = (struct ifreq *)data;
-		if (ifr->ifr_mtu > IEEE80211_MTU)
+		if (!(IEEE80211_MTU_MIN >= ifr->ifr_mtu &&
+		    ifr->ifr_mtu <= IEEE80211_MTU_MAX))
 			error = EINVAL;
 		else
 			ifp->if_mtu = ifr->ifr_mtu;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401110531.i0B5Vxgp066335>