Date: Thu, 19 May 2016 13:52:12 +0000 (UTC) From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300205 - head/sys/net Message-ID: <201605191352.u4JDqC3u075951@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Thu May 19 13:52:12 2016 New Revision: 300205 URL: https://svnweb.freebsd.org/changeset/base/300205 Log: Allow writing IP packets of length TUNMRU no matter if TUNSIFHEAD is set or not. Modified: head/sys/net/if_tun.c Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Thu May 19 13:32:44 2016 (r300204) +++ head/sys/net/if_tun.c Thu May 19 13:52:12 2016 (r300205) @@ -848,7 +848,7 @@ tunwrite(struct cdev *dev, struct uio *u struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = TUN2IFP(tp); struct mbuf *m; - uint32_t family; + uint32_t family, mru; int isr; TUNDEBUG(ifp, "tunwrite\n"); @@ -860,7 +860,10 @@ tunwrite(struct cdev *dev, struct uio *u if (uio->uio_resid == 0) return (0); - if (uio->uio_resid < 0 || uio->uio_resid > TUNMRU) { + mru = TUNMRU; + if (tp->tun_flags & TUN_IFHEAD) + mru += sizeof(family); + if (uio->uio_resid < 0 || uio->uio_resid > mru) { TUNDEBUG(ifp, "len=%zd!\n", uio->uio_resid); return (EIO); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605191352.u4JDqC3u075951>