Skip to contentSkip to conversation

txqueuelen for persistent interfaces

PATCH In review Roy Marples 3 participants 4 messages Nov 8, 2006 – Nov 9, 2006

lore
Share & tools
lore
#2 lore raw
Quoted 6 lines · Roy Marples
Quoted 5 lines · Roy Marples

Hi.

openvpn does not apply the --txqueuelen option to persistent interfaces made with --mktun [1]

Quoted 7 lines
Quoted 5 lines

Attached are patches to 2.0.7 and 2.1_rc1 that fix the issue.

Thanks!

[1] http://bugs.gentoo.org/show_bug.cgi?id=150791

And here are the patches - oops!

mailing list appears to be stripping attachments
Included inline

init.c 2006-11-08 13:33:24.000000000 +0000 renamed from init.c 2006-11-08 13:33:02.043877584 +0000 +0 -0
diff -u /tmp/openvpn-2.0.7/init.c openvpn-2.0.7/init.c
@@ -347,7 +347,8 @@
        msg (M_FATAL|M_OPTERR,
             "options --mktun or --rmtun should only be used together 
with --dev");
       tuncfg (options->dev, options->dev_type, options->dev_node,
-             options->tun_ipv6, options->persist_mode);
+             options->tun_ipv6, options->persist_mode,
+             &options->tuntap_options);
       return true;
     }

#endif

tun.c 2006-11-08 13:34:20.000000000 +0000 renamed from tun.c 2006-11-08 13:33:02.037878496 +0000 +0 -1
diff -u /tmp/openvpn-2.0.7/tun.c openvpn-2.0.7/tun.c
@@ -1095,13 +1095,14 @@
 #ifdef TUNSETPERSIST
 
 void
-tuncfg (const char *dev, const char *dev_type, const char *dev_node, bool 

ipv6, int persist_mode)
+tuncfg (const char *dev, const char *dev_type, const char *dev_node, bool ipv6, int persist_mode, const struct tuntap_options *options)
{
struct tuntap *tt;

ALLOC_OBJ (tt, struct tuntap);
clear_tuntap (tt);
tt->type = dev_type_enum (dev, dev_type);
+ tt->options = *options;
open_tun (dev, dev_type, dev_node, ipv6, tt); if (ioctl (tt->fd, TUNSETPERSIST, persist_mode) < 0)

     msg (M_ERR, "Cannot ioctl TUNSETPERSIST(%d) %s", persist_mode, dev);
tun.h 2006-11-08 13:33:50.000000000 +0000 renamed from tun.h 2006-11-08 13:33:02.042877736 +0000 +1 -1
diff -u /tmp/openvpn-2.0.7/tun.h openvpn-2.0.7/tun.h
@@ -194,7 +194,7 @@
 int read_tun (struct tuntap* tt, uint8_t *buf, int len);
 
 void tuncfg (const char *dev, const char *dev_type, const char *dev_node,
-            bool ipv6, int persist_mode);
+            bool ipv6, int persist_mode, const struct tuntap_options 

*options);

const char *guess_tuntap_dev (const char *dev,

init.c 2006-11-08 13:25:04.136530544 +0000 renamed from init.c 2006-10-15 23:30:20.000000000 +0100 +0 -0
diff -u openvpn-2.1_rc1/init.c /tmp/openvpn-2.1_rc1/init.c
@@ -425,7 +425,8 @@
        msg (M_FATAL|M_OPTERR,
             "options --mktun or --rmtun should only be used together 
with --dev");
       tuncfg (options->dev, options->dev_type, options->dev_node,
-             options->tun_ipv6, options->persist_mode);
+             options->tun_ipv6, options->persist_mode,
+             &options->tuntap_options);
       if (options->persist_mode && options->lladdr)
         set_lladdr(options->dev, options->lladdr, NULL);
       return true;
tun.c 2006-11-08 13:25:04.129531608 +0000 renamed from tun.c 2006-10-15 23:30:20.000000000 +0100 +0 -1
diff -u openvpn-2.1_rc1/tun.c /tmp/openvpn-2.1_rc1/tun.c
@@ -1163,13 +1163,14 @@
 #ifdef TUNSETPERSIST
 
 void
-tuncfg (const char *dev, const char *dev_type, const char *dev_node, bool 

ipv6, int persist_mode)
+tuncfg (const char *dev, const char *dev_type, const char *dev_node, bool ipv6, int persist_mode, const struct tuntap_options *options)
{
struct tuntap *tt;

ALLOC_OBJ (tt, struct tuntap);
clear_tuntap (tt);
tt->type = dev_type_enum (dev, dev_type);
+ tt->options = *options;
open_tun (dev, dev_type, dev_node, ipv6, tt); if (ioctl (tt->fd, TUNSETPERSIST, persist_mode) < 0)

     msg (M_ERR, "Cannot ioctl TUNSETPERSIST(%d) %s", persist_mode, dev);
tun.h 2006-11-08 13:25:04.135530696 +0000 renamed from tun.h 2006-10-15 23:30:20.000000000 +0100 +1 -1
diff -u openvpn-2.1_rc1/tun.h /tmp/openvpn-2.1_rc1/tun.h
@@ -204,7 +204,7 @@
 int read_tun (struct tuntap* tt, uint8_t *buf, int len);
 
 void tuncfg (const char *dev, const char *dev_type, const char *dev_node,
-            bool ipv6, int persist_mode);
+            bool ipv6, int persist_mode, const struct tuntap_options 

*options);

const char *guess_tuntap_dev (const char *dev,
const char *dev_type,

Signature · 1 line
Roy Marples <[email protected]...>
#3 lore raw
Quoted 118 lines · Roy Marples
Quoted 7 lines · Roy Marples
Quoted 5 lines · Roy Marples

Hi.

openvpn does not apply the --txqueuelen option to persistent interfaces made with --mktun [1]

Quoted 8 lines
Quoted 6 lines

Attached are patches to 2.0.7 and 2.1_rc1 that fix the issue.

Thanks!

[1] http://bugs.gentoo.org/show_bug.cgi?id=150791

And here are the patches - oops!

mailing list appears to be stripping attachments
Included inline

diff -u /tmp/openvpn-2.0.7/init.c openvpn-2.0.7/init.c

init.c 2006-11-08 13:33:24.000000000 +0000 renamed from init.c 2006-11-08 13:33:02.043877584 +0000 +2 -1
@@ -347,7 +347,8 @@
        msg (M_FATAL|M_OPTERR,
             "options --mktun or --rmtun should only be used together 
 with --dev");
       tuncfg (options->dev, options->dev_type, options->dev_node,
-             options->tun_ipv6, options->persist_mode);
+             options->tun_ipv6, options->persist_mode,
+             &options->tuntap_options);
       return true;
     }

#endif
diff -u /tmp/openvpn-2.0.7/tun.c openvpn-2.0.7/tun.c

tun.c 2006-11-08 13:34:20.000000000 +0000 renamed from tun.c 2006-11-08 13:33:02.037878496 +0000 +2 -1
@@ -1095,13 +1095,14 @@
 #ifdef TUNSETPERSIST
 
 void
-tuncfg (const char *dev, const char *dev_type, const char *dev_node, bool 
 ipv6, int persist_mode)
+tuncfg (const char *dev, const char *dev_type, const char *dev_node, bool 
 ipv6, int persist_mode, const struct tuntap_options *options)
 {
   struct tuntap *tt;
 
   ALLOC_OBJ (tt, struct tuntap);
   clear_tuntap (tt);
   tt->type = dev_type_enum (dev, dev_type);
+  tt->options = *options;
   open_tun (dev, dev_type, dev_node, ipv6, tt);
   if (ioctl (tt->fd, TUNSETPERSIST, persist_mode) < 0)
     msg (M_ERR, "Cannot ioctl TUNSETPERSIST(%d) %s", persist_mode, dev);

diff -u /tmp/openvpn-2.0.7/tun.h openvpn-2.0.7/tun.h

tun.h 2006-11-08 13:33:50.000000000 +0000 renamed from tun.h 2006-11-08 13:33:02.042877736 +0000 +1 -1
@@ -194,7 +194,7 @@
 int read_tun (struct tuntap* tt, uint8_t *buf, int len);
 
 void tuncfg (const char *dev, const char *dev_type, const char *dev_node,
-            bool ipv6, int persist_mode);
+            bool ipv6, int persist_mode, const struct tuntap_options 
 *options);
 
 const char *guess_tuntap_dev (const char *dev,

diff -u openvpn-2.1_rc1/init.c /tmp/openvpn-2.1_rc1/init.c

init.c 2006-11-08 13:25:04.136530544 +0000 renamed from init.c 2006-10-15 23:30:20.000000000 +0100 +2 -1
@@ -425,7 +425,8 @@
        msg (M_FATAL|M_OPTERR,
             "options --mktun or --rmtun should only be used together 
 with --dev");
       tuncfg (options->dev, options->dev_type, options->dev_node,
-             options->tun_ipv6, options->persist_mode);
+             options->tun_ipv6, options->persist_mode,
+             &options->tuntap_options);
       if (options->persist_mode && options->lladdr)
         set_lladdr(options->dev, options->lladdr, NULL);
       return true;

diff -u openvpn-2.1_rc1/tun.c /tmp/openvpn-2.1_rc1/tun.c

tun.c 2006-11-08 13:25:04.129531608 +0000 renamed from tun.c 2006-10-15 23:30:20.000000000 +0100 +2 -1
@@ -1163,13 +1163,14 @@
 #ifdef TUNSETPERSIST
 
 void
-tuncfg (const char *dev, const char *dev_type, const char *dev_node, bool 
 ipv6, int persist_mode)
+tuncfg (const char *dev, const char *dev_type, const char *dev_node, bool 
 ipv6, int persist_mode, const struct tuntap_options *options)
 {
   struct tuntap *tt;
 
   ALLOC_OBJ (tt, struct tuntap);
   clear_tuntap (tt);
   tt->type = dev_type_enum (dev, dev_type);
+  tt->options = *options;
   open_tun (dev, dev_type, dev_node, ipv6, tt);
   if (ioctl (tt->fd, TUNSETPERSIST, persist_mode) < 0)
     msg (M_ERR, "Cannot ioctl TUNSETPERSIST(%d) %s", persist_mode, dev);

diff -u openvpn-2.1_rc1/tun.h /tmp/openvpn-2.1_rc1/tun.h

tun.h 2006-11-08 13:25:04.135530696 +0000 renamed from tun.h 2006-10-15 23:30:20.000000000 +0100 +1 -1
@@ -204,7 +204,7 @@
 int read_tun (struct tuntap* tt, uint8_t *buf, int len);
 
 void tuncfg (const char *dev, const char *dev_type, const char *dev_node,
-            bool ipv6, int persist_mode);
+            bool ipv6, int persist_mode, const struct tuntap_options 
 *options);
 
 const char *guess_tuntap_dev (const char *dev,
Quoted 4 lines

const char *dev_type,

Roy -- thanks for fixing this, I will include in 2.1_rc2. Regarding the problem with attachments, I believe I have fixed it -- it was a misconfigured content filter in mailman.

James