[Openvpn-devel,v1] tun: drop no-op IFF_ONE_QUEUE on Linux

Message ID 20261116080609.440-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v1] tun: drop no-op IFF_ONE_QUEUE on Linux |

Commit Message

Gert Doering Nov. 16, 2026, 8:06 a.m. UTC
  From: Razvan Cojocaru <razvanc@mailbox.org>

The kernel ignores the flag since Linux 3.8, commit 5d097109257c ("tun:
only queue packets on device"). Also drop its guard around the
--txqueuelen code, since SIOCSIFTXQLEN is always available, and the
stale --tun-ipv6 comment.

Drop the outdated kernel version and init script note from INSTALL.

Change-Id: I272f840b547dde968ceca2c24de5a922f0721149
Signed-off-by: Razvan Cojocaru <razvanc@mailbox.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2185
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2185
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <gert@greenie.muc.de>
  

Comments

Gert Doering Nov. 16, 2026, 9:05 a.m. UTC | #1
Antonio has confirmed "this can go" from the linux kernel side, and
so it goes... our oldest still supported Linux is RHEL8, and even that
has a much more recent kernel.  Happy to see two #ifdef go!

Test compiled myself, and via BB (201 green!).

(It reminds me that INSTALL needs to be scrutinized for all the *BSD
variants... I guess at least the DragonFly section needs work)

Again, "cleanup, no user visible issue = no 2.7"

Your patch has been applied to the master branch.

commit f5329ed2623e0bd148c43e0cdfef8bec6e998010
Author: Razvan Cojocaru
Date:   Mon Nov 16 09:06:03 2026 +0100

     tun: drop no-op IFF_ONE_QUEUE on Linux

     Signed-off-by: Razvan Cojocaru <razvanc@mailbox.org>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2185
     Message-Id: <20261116080609.440-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg41384.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering
  

Patch

diff --git a/INSTALL b/INSTALL
index d0ffaf0..0484e98 100644
--- a/INSTALL
+++ b/INSTALL
@@ -226,13 +226,10 @@ 
 
 TUN/TAP Driver References:
 
-* Linux 2.6 or higher (with integrated TUN/TAP driver):
+* Linux (with integrated TUN/TAP driver):
 
-  (1) load driver:              modprobe tun
-  (2) enable routing:           echo 1 > /proc/sys/net/ipv4/ip_forward
-
-  Note that (1) needs to be done once per reboot.  If you install from RPM (see
-  above) and use the openvpn.init script, these steps are taken care of for you.
+  (1) load driver (only if /dev/net/tun is missing):  modprobe tun
+  (2) enable routing:  echo 1 > /proc/sys/net/ipv4/ip_forward
 
 * FreeBSD:
 
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 70fdd7e..0ba8a4a 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -2123,16 +2123,9 @@ 
             msg(M_ERR, "ERROR: Cannot open TUN/TAP dev %s", node);
         }
 
-        /*
-         * Process --tun-ipv6
-         */
         CLEAR(ifr);
         ifr.ifr_flags = IFF_NO_PI;
 
-#if defined(IFF_ONE_QUEUE) && defined(SIOCSIFTXQLEN)
-        ifr.ifr_flags |= IFF_ONE_QUEUE;
-#endif
-
 #ifdef IFF_BACKPRESSURE
         ifr.ifr_flags |= IFF_BACKPRESSURE;
 #endif
@@ -2175,7 +2168,6 @@ 
         /*
          * Try making the TX send queue bigger
          */
-#if defined(IFF_ONE_QUEUE) && defined(SIOCSIFTXQLEN)
         if (tt->options.txqueuelen)
         {
             struct ifreq netifr;
@@ -2201,7 +2193,6 @@ 
                 msg(M_WARN | M_ERRNO, "Note: Cannot open control socket on %s", ifr.ifr_name);
             }
         }
-#endif /* if defined(IFF_ONE_QUEUE) && defined(SIOCSIFTXQLEN) */
 
         set_nonblock(tt->fd);
         set_cloexec(tt->fd);