From 3f410e2f8f7c365630f226adf4904935698f9e0d Mon Sep 17 00:00:00 2001 From: Brandon L Black Date: Sat, 13 Nov 2010 12:05:48 -0600 Subject: [PATCH] Experimental IFF_ONE_QUEUE support for Linux --- doc/tinc.conf.5.in | 3 +++ src/linux/device.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/doc/tinc.conf.5.in b/doc/tinc.conf.5.in index 2bfd5fef..01f7f810 100644 --- a/doc/tinc.conf.5.in +++ b/doc/tinc.conf.5.in @@ -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. +.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. diff --git a/src/linux/device.c b/src/linux/device.c index 6c828c01..0632d51a 100644 --- a/src/linux/device.c +++ b/src/linux/device.c @@ -52,6 +52,7 @@ static uint64_t device_total_out = 0; bool setup_device(void) { struct ifreq ifr; + bool t1q = false; 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)"; } +#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); -- 2.20.1