Experimental IFF_ONE_QUEUE support for Linux
authorBrandon L Black <blblack@gmail.com>
Sat, 13 Nov 2010 18:05:48 +0000 (12:05 -0600)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 13 Nov 2010 20:25:41 +0000 (21:25 +0100)
doc/tinc.conf.5.in
src/linux/device.c

index 2bfd5fef94f8b2f6f0afa5f47540ef49b54362ef..01f7f810d993b242b41801d0ad62300c3ea69ae7 100644 (file)
@@ -255,6 +255,9 @@ a lookup if your DNS server is not responding.
 This does not affect resolving hostnames to IP addresses from the
 host configuration files.
 
 This does not affect resolving hostnames to IP addresses from the
 host configuration files.
 
+.It Va IffOneQueue Li = yes | no Po no Pc Bq experimental
+(Linux only) Set IFF_ONE_QUEUE flag on TUN/TAP devices.
+
 .It Va Interface Li = Ar interface
 Defines the name of the interface corresponding to the virtual network device.
 Depending on the operating system and the type of device this may or may not actually set the name of the interface.
 .It Va Interface Li = Ar interface
 Defines the name of the interface corresponding to the virtual network device.
 Depending on the operating system and the type of device this may or may not actually set the name of the interface.
index 6c828c01d84f1909ab15ae8093a7ab56c7f71e9e..0632d51aff21fc2399c4847697c0468063100c0b 100644 (file)
@@ -52,6 +52,7 @@ static uint64_t device_total_out = 0;
 
 bool setup_device(void) {
        struct ifreq ifr;
 
 bool setup_device(void) {
        struct ifreq ifr;
+       bool t1q = false;
 
        if(!get_config_string(lookup_config(config_tree, "Device"), &device))
                device = xstrdup(DEFAULT_DEVICE);
 
        if(!get_config_string(lookup_config(config_tree, "Device"), &device))
                device = xstrdup(DEFAULT_DEVICE);
@@ -84,6 +85,12 @@ bool setup_device(void) {
                device_info = "Linux tun/tap device (tap mode)";
        }
 
                device_info = "Linux tun/tap device (tap mode)";
        }
 
+#ifdef IFF_ONE_QUEUE
+       /* Set IFF_ONE_QUEUE flag... */
+       if(get_config_bool(lookup_config(config_tree, "IffOneQueue"), &t1q) && t1q)
+               ifr.ifr_flags |= IFF_ONE_QUEUE;
+#endif
+
        if(iface)
                strncpy(ifr.ifr_name, iface, IFNAMSIZ);
 
        if(iface)
                strncpy(ifr.ifr_name, iface, IFNAMSIZ);