summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-08-06 13:53:03 +0000
committerbrian <brian@FreeBSD.org>1999-08-06 13:53:03 +0000
commit29c67703e3751c283a1bdfe7764effe015c13b83 (patch)
treeef1e40a5b9d87f3d7f7d7336ae7dc5a534520d3d /sys/net/if.c
parentdf1c1756e31202c817f6c35422ebc847da176a0a (diff)
downloadFreeBSD-src-29c67703e3751c283a1bdfe7764effe015c13b83.zip
FreeBSD-src-29c67703e3751c283a1bdfe7764effe015c13b83.tar.gz
Define IF_MAXMTU and IF_MINMTU and don't allow MTUs with
out-of-range values. ``comparison is always 0'' warnings are silly ! Ok'd by: wollman, dg Advised by: bde
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index c6f5c5e..1887c91 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.72 1999/06/06 09:28:01 phk Exp $
+ * $Id: if.c,v 1.73 1999/06/19 18:42:26 phk Exp $
*/
#include "opt_compat.h"
@@ -685,11 +685,7 @@ ifioctl(so, cmd, data, p)
return (error);
if (ifp->if_ioctl == NULL)
return (EOPNOTSUPP);
- /*
- * 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)
+ if (ifr->ifr_mtu < IF_MINMTU || ifr->ifr_mtu > IF_MAXMTU)
return (EINVAL);
error = (*ifp->if_ioctl)(ifp, cmd, data);
if (error == 0)
OpenPOWER on IntegriCloud