diff --git a/sys/net/if_tap.h b/sys/net/if_tap.h index 90772af7149..9718cee4e2d 100644 --- a/sys/net/if_tap.h +++ b/sys/net/if_tap.h @@ -55,7 +55,7 @@ #define TAPGDEBUG TUNGDEBUG #define TAPSIFINFO TUNSIFINFO #define TAPGIFINFO TUNGIFINFO -#define TAPGIFNAME _IOR('t', 93, struct ifreq) +#define TAPGIFNAME TUNGIFNAME /* VMware ioctl's */ #define VMIO_SIOCSIFFLAGS _IOWINT('V', 0) diff --git a/sys/net/if_tun.h b/sys/net/if_tun.h index 1ea375f745d..a44c87bd0a4 100644 --- a/sys/net/if_tun.h +++ b/sys/net/if_tun.h @@ -40,6 +40,7 @@ struct tuninfo { #define TUNSIFINFO _IOW('t', 91, struct tuninfo) #define TUNGIFINFO _IOR('t', 92, struct tuninfo) #define TUNSLMODE _IOW('t', 93, int) +#define TUNGIFNAME _IOR('t', 93, struct ifreq) #define TUNSIFMODE _IOW('t', 94, int) #define TUNSIFPID _IO('t', 95) #define TUNSIFHEAD _IOW('t', 96, int) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 0f56208103f..0b641780300 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -1235,12 +1235,6 @@ tunioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, if (l2tun) { /* tap specific ioctls */ switch(cmd) { - case TAPGIFNAME: - ifrp = (struct ifreq *)data; - strlcpy(ifrp->ifr_name, TUN2IFP(tp)->if_xname, - IFNAMSIZ); - - return (0); /* VMware/VMnet port ioctl's */ #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD4) @@ -1337,6 +1331,11 @@ tunioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, } switch (cmd) { + case TUNGIFNAME: + ifrp = (struct ifreq *)data; + strlcpy(ifrp->ifr_name, TUN2IFP(tp)->if_xname, IFNAMSIZ); + + return (0); case TUNSIFINFO: tunp = (struct tuninfo *)data; if (TUN2IFP(tp)->if_type != tunp->type)