Author: kevans
Date: Thu Jul 25 22:23:34 2019
New Revision: 350336
URL: https://svnweb.freebsd.org/changeset/base/350336

Log:
  if_tuntap(4): Add TUNGIFNAME
  
  This effectively just moves TAPGIFNAME into common ioctl territory.
  
  MFC after:    3 days

Modified:
  head/sys/net/if_tap.h
  head/sys/net/if_tun.h
  head/sys/net/if_tuntap.c

Modified: head/sys/net/if_tap.h
==============================================================================
--- head/sys/net/if_tap.h       Thu Jul 25 22:02:55 2019        (r350335)
+++ head/sys/net/if_tap.h       Thu Jul 25 22:23:34 2019        (r350336)
@@ -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)

Modified: head/sys/net/if_tun.h
==============================================================================
--- head/sys/net/if_tun.h       Thu Jul 25 22:02:55 2019        (r350335)
+++ head/sys/net/if_tun.h       Thu Jul 25 22:23:34 2019        (r350336)
@@ -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)

Modified: head/sys/net/if_tuntap.c
==============================================================================
--- head/sys/net/if_tuntap.c    Thu Jul 25 22:02:55 2019        (r350335)
+++ head/sys/net/if_tuntap.c    Thu Jul 25 22:23:34 2019        (r350336)
@@ -1235,12 +1235,6 @@ tunioctl(struct cdev *dev, u_long cmd, caddr_t data, i
        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, i
        }
 
        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)
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to