From: Jonathan Gray Subject: remove unused TUN_DEBUG/TUNDEBUG To: tech@openbsd.org Date: Sun, 10 May 2026 18:17:54 +1000 these macros and ioctls are unused diff --git sys/net/if_tun.c sys/net/if_tun.c index 9486afb1eaf..3edd937989b 100644 --- sys/net/if_tun.c +++ sys/net/if_tun.c @@ -35,8 +35,6 @@ * operation though. */ -/* #define TUN_DEBUG 9 */ - #include #include #include @@ -90,13 +88,6 @@ struct tun_softc { unsigned int sc_reading; }; -#ifdef TUN_DEBUG -int tundebug = TUN_DEBUG; -#define TUNDEBUG(a) (tundebug? printf a : 0) -#else -#define TUNDEBUG(a) /* (tundebug? printf a : 0) */ -#endif - /* Pretend that these IFF flags are changeable by TUNSIFINFO */ #define TUN_IFF_FLAGS (IFF_POINTOPOINT|IFF_MULTICAST|IFF_BROADCAST) @@ -727,14 +718,6 @@ tun_dev_ioctl(dev_t dev, u_long cmd, void *data) tunp->flags = sc->sc_if.if_flags & TUN_IFF_FLAGS; tunp->baudrate = sc->sc_if.if_baudrate; break; -#ifdef TUN_DEBUG - case TUNSDEBUG: - tundebug = *(int *)data; - break; - case TUNGDEBUG: - *(int *)data = tundebug; - break; -#endif case TUNSIFMODE: if (*(int *)data != (sc->sc_if.if_flags & TUN_IFF_FLAGS)) { error = EINVAL; diff --git sys/net/if_tun.h sys/net/if_tun.h index fb40345744e..5b5d340f268 100644 --- sys/net/if_tun.h +++ sys/net/if_tun.h @@ -107,10 +107,6 @@ struct tuninfo { /* ioctl for changing the broadcast/point-to-point status */ #define TUNSIFMODE _IOW('t', 93, int) -/* ioctl's for get/set debug */ -#define TUNSDEBUG _IOW('t', 94, int) -#define TUNGDEBUG _IOR('t', 95, int) - struct tun_capabilities { uint32_t tun_if_capabilities; /* IFCAP_* from net/if.h */ };