Index: if_tun.c =================================================================== RCS file: /cvs/src/sys/net/if_tun.c,v retrieving revision 1.181 diff -u -p -r1.181 if_tun.c --- if_tun.c 24 Feb 2018 07:20:04 -0000 1.181 +++ if_tun.c 12 Nov 2018 06:02:51 -0000 @@ -193,6 +193,9 @@ tun_create(struct if_clone *ifc, int uni struct tun_softc *tp; struct ifnet *ifp; + if (unit > minor(~0U)) + return (ENXIO); + tp = malloc(sizeof(*tp), M_DEVBUF, M_WAITOK|M_ZERO); tp->tun_unit = unit; tp->tun_flags = TUN_INITED|TUN_STAYUP;