Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Sep 2016 03:14:36 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r422480 - in head/net/vtun: . files
Message-ID:  <201609200314.u8K3EaUQ087702@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cy
Date: Tue Sep 20 03:14:36 2016
New Revision: 422480
URL: https://svnweb.freebsd.org/changeset/ports/422480

Log:
  Replace the vtun-v6 extra patch from
  http://home.jp.FreeBSD.org/~simokawa/vtun-v6.html with a -e option
  on the command line.

Added:
  head/net/vtun/files/patch-freebsd__tun_dev.c
     - copied, changed from r422479, head/net/vtun/files/extra-tun_dev.c
Deleted:
  head/net/vtun/files/extra-tun_dev.c
Modified:
  head/net/vtun/Makefile
  head/net/vtun/files/patch-main.c

Modified: head/net/vtun/Makefile
==============================================================================
--- head/net/vtun/Makefile	Tue Sep 20 02:55:18 2016	(r422479)
+++ head/net/vtun/Makefile	Tue Sep 20 03:14:36 2016	(r422480)
@@ -3,7 +3,7 @@
 
 PORTNAME=	vtun
 PORTVERSION=	3.0.4
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net
 MASTER_SITES=	SF
 
@@ -30,11 +30,11 @@ ALL_TARGET=	vtund
 DOCS=		ChangeLog Credits FAQ README README.LZO README.Setup \
 		README.Shaper TODO
 
-OPTIONS_DEFINE=	DOCS EXTENDED_MODE
-EXTENDED_MODE_DESC=	Use vtun-v6 EXTENDED_MODE patch
+OPTIONS_DEFINE=	DOCS
 
-# Obtained from http://home.jp.FreeBSD.org/~simokawa/vtun-v6.html
-EXTENDED_MODE_EXTRA_PATCHES=	${FILESDIR}/extra-tun_dev.c
+# Extended mode patches, obtained from
+# http://home.jp.FreeBSD.org/~simokawa/vtun-v6.html
+# are now dynamically enabled using the -e option.
 
 .include <bsd.port.options.mk>
 

Copied and modified: head/net/vtun/files/patch-freebsd__tun_dev.c (from r422479, head/net/vtun/files/extra-tun_dev.c)
==============================================================================
--- head/net/vtun/files/extra-tun_dev.c	Tue Sep 20 02:55:18 2016	(r422479, copy source)
+++ head/net/vtun/files/patch-freebsd__tun_dev.c	Tue Sep 20 03:14:36 2016	(r422480)
@@ -1,13 +1,24 @@
---- freebsd/tun_dev.c.orig	Thu Aug 26 16:45:24 2004
-+++ freebsd/tun_dev.c	Thu Aug 26 16:45:42 2004
-@@ -58,8 +58,8 @@
+--- freebsd/tun_dev.c.orig	2008-01-07 14:36:10.000000000 -0800
++++ freebsd/tun_dev.c	2016-09-19 20:06:49.919502000 -0700
+@@ -35,6 +35,8 @@
+ #include "vtun.h"
+ #include "lib.h"
+ 
++extern int extended_mode;
++
+ /* 
+  * Allocate TUN device, returns opened fd. 
+  * Stores dev name in the first arg(must be large enough).
+@@ -58,10 +60,8 @@
         }
      }
      if( fd > -1 ){
 -       i=0;
 -       /* Disable extended modes */
-+       i=1;
-+       /* Enable extended modes */
-        ioctl(fd, TUNSLMODE, &i);	
-        ioctl(fd, TUNSIFHEAD, &i);
+-       ioctl(fd, TUNSLMODE, &i);	
+-       ioctl(fd, TUNSIFHEAD, &i);
++       ioctl(fd, TUNSLMODE, &extended_mode);	
++       ioctl(fd, TUNSIFHEAD, &extended_mode);
      }	
+     return fd;
+ }

Modified: head/net/vtun/files/patch-main.c
==============================================================================
--- head/net/vtun/files/patch-main.c	Tue Sep 20 02:55:18 2016	(r422479)
+++ head/net/vtun/files/patch-main.c	Tue Sep 20 03:14:36 2016	(r422480)
@@ -1,24 +1,28 @@
 --- main.c.orig	2013-07-07 13:31:22.000000000 -0700
-+++ main.c	2016-09-19 18:44:42.369746000 -0700
-@@ -41,7 +41,7 @@
++++ main.c	2016-09-19 20:05:37.120740000 -0700
+@@ -39,9 +39,9 @@
+ #include "lib.h"
+ #include "compat.h"
  
- #define OPTSTRING "mif:P:L:t:npq"
+-#define OPTSTRING "mif:P:L:t:npq"
++#define OPTSTRING "mif:P:L:t:npqe"
  #ifdef HAVE_WORKING_FORK
 -#  define SERVOPT_STRING "s"
 +#  define SERVOPT_STRING "sz:"
  #else
  #  define SERVOPT_STRING ""
  #endif
-@@ -57,6 +57,8 @@
+@@ -57,6 +57,9 @@
  extern int optind,opterr,optopt;
  extern char *optarg;
  
 +static char* pidfile = VTUN_PID_FILE;
++int extended_mode = 0;
 +
  /* for the NATHack bit.  Is our UDP session connected? */
  int is_rmt_fd_connected=1; 
  
-@@ -141,6 +143,11 @@
+@@ -141,6 +144,14 @@
  	    case 'q':
  		vtun.quiet = 1;
  		break;
@@ -27,10 +31,13 @@
 +		pidfile = strdup(optarg);
 +		break;
 +#endif
++	    case 'e':
++		extended_mode = 1;
++		break;
  	    default:
  		usage();
  	        exit(1);
-@@ -250,7 +257,7 @@
+@@ -250,7 +261,7 @@
  {
       FILE *f;
  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609200314.u8K3EaUQ087702>