Skip to contentSkip to conversation

Urgent: Limitation to 100 virtual tunnel dev ices??

Openvpn-devel Daniel Berger 2 participants 2 messages Jul 8, 2004

lore
Share & tools
lore
#0 lore raw
Quoted 10 lines

I assume you need the following patch:

diff -urN linux-2.4.26.org/net/core/dev.c linux-2.4.26/net/core/dev.c

net/core/dev.c +0 -0
@@ -619,8 +619,12 @@
 
 	/*
 	 * If you need over 100 please also fix the algorithm...

net/core/dev.c line 630

Quoted 10 lines
net/core/dev.c +5 -1
+	 *
+	 * Maybe it's never needed but just to be sure we allow
+	 * up to 1000 tun/tap devices.
+	 *
 	 */
-	for (i = 0; i < 100; i++) {
+	for (i = 0; i < 1000; i++) {
 		snprintf(buf,sizeof(buf),name,i);
 		if (__dev_get_by_name(buf) == NULL) {
 			strcpy(dev->name, buf);

can this info be added to http://openvpn.sourceforge.net/install.html
so that everyone knows it in the future?

How is this with Kernel 2.6?
I checked the source of 2.6.7, but could'nt find this codefragment in /net/core/dev.c
Anyone knows the limint in 2.6?

Dani

#1 lore raw
Quoted 7 lines · Daniel Berger
Quoted 7 lines

I assume you need the following patch:

diff -urN linux-2.4.26.org/net/core/dev.c linux-2.4.26/net/core/dev.c

net/core/dev.c +0 -0
@@ -619,8 +619,12 @@
 
Quoted 18 lines
Quoted 5 lines
net/core/dev.c +0 -0
 	/*
 	 * If you need over 100 please also fix the algorithm...

net/core/dev.c line 630

Quoted 10 lines
net/core/dev.c +5 -1
+	 *
+	 * Maybe it's never needed but just to be sure we allow
+	 * up to 1000 tun/tap devices.
+	 *
 	 */
-	for (i = 0; i < 100; i++) {
+	for (i = 0; i < 1000; i++) {
 		snprintf(buf,sizeof(buf),name,i);
 		if (__dev_get_by_name(buf) == NULL) {
 			strcpy(dev->name, buf);

I just look at the code in FreeBSD, it handles 1000 tunnel by default:
case MOD_LOAD:

               /* intitialize device */   

               mtx_init(&tapmtx, "tapmtx", NULL, MTX_DEF);
               SLIST_INIT(&taphead);

               clone_setup(&tapclones);
               eh_tag = EVENTHANDLER_REGISTER(dev_clone, tapclone, 0, 
1000);
               if (eh_tag == NULL) {
                       clone_cleanup(&tapclones);
                       mtx_destroy(&tapmtx);
                       return (ENOMEM);
               }
               return (0);

Sit back and relax. :)
sam

Quoted 11 lines

can this info be added to http://openvpn.sourceforge.net/install.html
so that everyone knows it in the future?

How is this with Kernel 2.6? I checked the source of 2.6.7, but could'nt find this codefragment in /net/core/dev.c
Anyone knows the limint in 2.6?

Dani