diff options
| author | Sam Leffler <sam@FreeBSD.org> | 2004-01-13 06:22:55 +0000 |
|---|---|---|
| committer | Sam Leffler <sam@FreeBSD.org> | 2004-01-13 06:22:55 +0000 |
| commit | 6f161f034286d4a318e4609c6e3f59d4acfff9fe (patch) | |
| tree | 390e3c64186554ac7917301427589c29aa45624c /sys/net80211 | |
| parent | 22acb4fa32aefd5680c89d50dc949d28c9013e32 (diff) | |
Notes
Diffstat (limited to 'sys/net80211')
| -rw-r--r-- | sys/net80211/ieee80211.h | 11 | ||||
| -rw-r--r-- | sys/net80211/ieee80211_ioctl.c | 8 |
2 files changed, 18 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index 7ad623119966..217bbf0aefa9 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -360,7 +360,16 @@ enum { #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 \ diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 64a8879dde93..1c7df74358b7 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -1017,6 +1017,14 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) ifr = (struct ifreq *)data; copyout(&ic->ic_stats, ifr->ifr_data, sizeof (ic->ic_stats)); break; + case SIOCSIFMTU: + ifr = (struct ifreq *)data; + if (!(IEEE80211_MTU_MIN <= ifr->ifr_mtu && + ifr->ifr_mtu <= IEEE80211_MTU_MAX)) + error = EINVAL; + else + ifp->if_mtu = ifr->ifr_mtu; + break; default: error = ether_ioctl(ifp, cmd, data); break; |
