From b7f56c720419d57c6fd04f8556283eb6cf9ef4e7 Mon Sep 17 00:00:00 2001 From: fenner Date: Mon, 16 Dec 1996 19:23:34 +0000 Subject: Change default tun MTU back to 1500. Use the interface MTU instead of the constant when deciding what packets to accept. Allow using the SIOCSIFMTU ioctl (e.g. "ifconfig tun0 mtu XXX") to set the MTU. --- sys/net/if_tun.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys/net/if_tun.c') diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 0b740e5..df84d53 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -268,6 +268,11 @@ tunifioctl(ifp, cmd, data) TUNDEBUG("%s%d: destination address set\n", ifp->if_name, ifp->if_unit); break; + case SIOCSIFMTU: + ifp->if_mtu = ifr->ifr_mtu; + TUNDEBUG("%s%d: mtu set\n", + ifp->if_name, ifp->if_unit); + break; case SIOCADDMULTI: case SIOCDELMULTI: if (ifr == 0) { @@ -519,7 +524,7 @@ tunwrite(dev_t dev, struct uio *uio, int flag) TUNDEBUG("%s%d: tunwrite\n", ifp->if_name, ifp->if_unit); - if (uio->uio_resid < 0 || uio->uio_resid > TUNMTU) { + if (uio->uio_resid < 0 || uio->uio_resid > ifp->if_mtu) { TUNDEBUG("%s%d: len=%d!\n", ifp->if_name, ifp->if_unit, uio->uio_resid); return EIO; -- cgit v1.1