summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-08-08 11:43:44 +0000
committerdg <dg@FreeBSD.org>1994-08-08 11:43:44 +0000
commit4eb7e7f1c4f88d90fb0b4d34026548de68a78528 (patch)
treec4383145971015f4f2fcfebb90e974276569c76a /sys/net/if.c
parent6a73fab070480164f53deb222e4bf079ece7aed7 (diff)
downloadFreeBSD-src-4eb7e7f1c4f88d90fb0b4d34026548de68a78528.zip
FreeBSD-src-4eb7e7f1c4f88d90fb0b4d34026548de68a78528.tar.gz
On second thought, better restrict the mtu to between 72-65535...strange
things happen otherwise.
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 5a60f6e..76718e2 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if.c 8.3 (Berkeley) 1/4/94
- * $Id: if.c,v 1.3 1994/08/08 10:49:18 davidg Exp $
+ * $Id: if.c,v 1.4 1994/08/08 10:58:30 davidg Exp $
*/
#include <sys/param.h>
@@ -520,7 +520,11 @@ ifioctl(so, cmd, data, p)
return (error);
if (ifp->if_ioctl == NULL)
return (EOPNOTSUPP);
- if (ifr->ifr_mtu < 1 || ifr->ifr_mtu > 65535)
+ /*
+ * 72 was chosen below because it is the size of a TCP/IP
+ * header (40) + the minimum mss (32).
+ */
+ if (ifr->ifr_mtu < 72 || ifr->ifr_mtu > 65535)
return (EINVAL);
return ((*ifp->if_ioctl)(ifp, cmd, data));
OpenPOWER on IntegriCloud