Index: head/net/vtun/Makefile =================================================================== --- head/net/vtun/Makefile (revision 517564) +++ head/net/vtun/Makefile (revision 517565) @@ -1,60 +1,56 @@ # Created by: Kevin Lo # $FreeBSD$ PORTNAME= vtun PORTVERSION= 3.0.4 -PORTREVISION= 7 +PORTREVISION= 8 CATEGORIES= net -MASTER_SITES= SF +MASTER_SITES= SF LOCAL/mat/vtun MAINTAINER= mat@FreeBSD.org COMMENT= Virtual Tunnels over TCP/IP networks with traffic shaping -BROKEN= unfetchable - LICENSE= GPLv2 -DEPRECATED= No longer supported by upline -EXPIRATION_DATE= 2021-09-30 - LIB_DEPENDS= liblzo2.so:archivers/lzo2 -CFLAGS+= -ansi -Wno-pointer-sign USES= autoreconf localbase ssl +USE_RC_SUBR= vtunclient vtund GNU_CONFIGURE= yes + CONFIGURE_ARGS= --localstatedir=/var \ --with-ssl-headers=${OPENSSLINC} \ --with-ssl-lib=${OPENSSLLIB} \ --with-lzo-headers=${LOCALBASE}/include/lzo \ --with-lzo-lib=${LOCALBASE}/lib CONFIGURE_ENV= YACC=${YACC} -USE_RC_SUBR= vtunclient vtund +CFLAGS+= -ansi -Wno-pointer-sign + ALL_TARGET= vtund DOCS= ChangeLog Credits FAQ README README.LZO README.Setup \ README.Shaper TODO OPTIONS_DEFINE= DOCS # Extended mode patches, obtained from # http://home.jp.FreeBSD.org/~simokawa/vtun-v6.html # are now dynamically enabled using the -e option. post-patch: ${REINPLACE_CMD} \ -e 's|$$\(SSL_HDR_DIR\)|$$\1 $$\1/openssl|g' \ -e 's|$$\(BLOWFISH_HDR_DIR\)|$$\1 $$SSL_HDR_DIR/openssl|g' \ ${WRKSRC}/configure post-install: - @${STRIP_CMD} ${STAGEDIR}${PREFIX}/sbin/vtund - @${INSTALL_DATA} ${WRKSRC}/vtund.conf ${STAGEDIR}${PREFIX}/etc/vtund.conf.sample - @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${STRIP_CMD} ${STAGEDIR}${PREFIX}/sbin/vtund + ${INSTALL_DATA} ${WRKSRC}/vtund.conf ${STAGEDIR}${PREFIX}/etc/vtund.conf.sample + ${MKDIR} ${STAGEDIR}${DOCSDIR} .for doc in ${DOCS} - @${INSTALL_DATA} ${WRKSRC}/${doc} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/${doc} ${STAGEDIR}${DOCSDIR} .endfor - @cd ${STAGEDIR}${PREFIX}/man/man1/ && \ - ${LN} -s vtund.8 ../man1/vtun.1 + ${RLN} ${STAGEDIR}${PREFIX}/man/man8/vtund.8 ${STAGEDIR}${PREFIX}/man/man1/vtun.1 .include Index: head/net/vtun/distinfo =================================================================== --- head/net/vtun/distinfo (revision 517564) +++ head/net/vtun/distinfo (revision 517565) @@ -1,3 +1,3 @@ -TIMESTAMP = 1474289088 -SHA256 (vtun-3.0.4.tar.gz) = 79d9ccfec98bb13b19523c483f2192e6db7d0c24af8382506f80cc335c643085 -SIZE (vtun-3.0.4.tar.gz) = 130877 +TIMESTAMP = 1573738292 +SHA256 (vtun-3.0.4.tar.gz) = abf8df6b15e3febeaaeae2ce24ead7105eb1537ad4ec0d830c83cbb684fd98b9 +SIZE (vtun-3.0.4.tar.gz) = 132691 Index: head/net/vtun/files/patch-Makefile.in =================================================================== --- head/net/vtun/files/patch-Makefile.in (revision 517564) +++ head/net/vtun/files/patch-Makefile.in (revision 517565) @@ -1,52 +1,54 @@ ---- Makefile.in.orig 2012-07-08 21:55:38.000000000 -0700 -+++ Makefile.in 2014-06-09 23:06:38.000000000 -0700 -@@ -28,7 +28,7 @@ +Cleanup install procedure. + +--- Makefile.in.orig 2016-10-01 21:46:00 UTC ++++ Makefile.in +@@ -28,7 +28,7 @@ LEX = @LEX@ LEXFLAGS = -t INSTALL = @INSTALL@ -INSTALL_OWNER = -o root -g 0 +INSTALL_OWNER = prefix = @prefix@ exec_prefix = @exec_prefix@ -@@ -55,7 +55,7 @@ +@@ -55,7 +55,7 @@ OBJS = main.o cfg_file.tab.o cfg_file.lex.o server.o c CONFIGURE_FILES = Makefile config.status config.cache config.h config.log -%.o: %.c vtun.h lib.h +.c.o: $(CC) $(CFLAGS) $(DEFS) -c $< vtund: $(OBJS) -@@ -80,25 +80,25 @@ +@@ -80,25 +80,25 @@ distclean: clean rm -f `cat vtun.drivers` install_man: - $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(MAN_DIR)/man8 +# $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(MAN_DIR)/man8 $(INSTALL) -m 644 $(INSTALL_OWNER) vtund.8 $(DESTDIR)$(MAN_DIR)/man8 - $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(MAN_DIR)/man5 +# $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(MAN_DIR)/man5 $(INSTALL) -m 644 $(INSTALL_OWNER) vtund.conf.5 $(DESTDIR)$(MAN_DIR)/man5 rm -f $(DESTDIR)$(MAN_DIR)/man8/vtun.8 ln -s vtund.8 $(DESTDIR)$(MAN_DIR)/man8/vtun.8 install_config: - $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(ETC_DIR) +# $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(ETC_DIR) if [ ! -f $(ETC_DIR)/vtund.conf ]; then \ $(INSTALL) -m 600 $(INSTALL_OWNER) vtund.conf $(DESTDIR)$(ETC_DIR); \ fi install: vtund install_config install_man - $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(VAR_DIR)/run +# $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(VAR_DIR)/run $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(STAT_DIR) $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(LOCK_DIR) - $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(SBIN_DIR) +# $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(SBIN_DIR) $(INSTALL) -m 755 $(INSTALL_OWNER) vtund $(DESTDIR)$(SBIN_DIR) - $(BIN_DIR)/strip $(DESTDIR)$(SBIN_DIR)/vtund + /usr/bin/strip $(DESTDIR)$(SBIN_DIR)/vtund # DO NOT DELETE THIS LINE -- make depend depends on it. Index: head/net/vtun/files/patch-freebsd__tun_dev.c =================================================================== --- head/net/vtun/files/patch-freebsd__tun_dev.c (revision 517564) +++ head/net/vtun/files/patch-freebsd__tun_dev.c (revision 517565) @@ -1,24 +1,26 @@ ---- 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 +Part of extended mode being an argument and not a compile time decision. + +--- freebsd/tun_dev.c.orig 2016-10-01 21:46:01 UTC ++++ freebsd/tun_dev.c @@ -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 @@ +@@ -58,10 +60,8 @@ int tun_open(char *dev) } } if( fd > -1 ){ - i=0; - /* Disable extended modes */ - ioctl(fd, TUNSLMODE, &i); - ioctl(fd, TUNSIFHEAD, &i); + ioctl(fd, TUNSLMODE, &extended_mode); + ioctl(fd, TUNSIFHEAD, &extended_mode); } return fd; } Index: head/net/vtun/files/patch-main.c =================================================================== --- head/net/vtun/files/patch-main.c (revision 517564) +++ head/net/vtun/files/patch-main.c (revision 517565) @@ -1,79 +1,82 @@ +Part of extended mode being an argument and not a compile time decision. +Some bits about using vfork, or not, and pidfile as an argument. + --- main.c.orig 2013-07-07 20:31:22 UTC +++ main.c @@ -39,9 +39,9 @@ #include "lib.h" #include "compat.h" -#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,9 @@ static void usage(void); 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 +144,14 @@ int main(int argc, char *argv[], char *env[]) case 'q': vtun.quiet = 1; break; +#ifdef HAVE_WORKING_FORK + case 'z': + pidfile = strdup(optarg); + break; +#endif + case 'e': + extended_mode = 1; + break; default: usage(); exit(1); @@ -233,6 +244,9 @@ int main(int argc, char *argv[], char *env[]) server(sock); } else { +#ifdef HAVE_WORKING_FORK + write_pid(); +#endif init_title(argc,argv,env,"vtund[c]: "); client(host); } @@ -250,7 +264,7 @@ static void write_pid(void) { FILE *f; - if( !(f=fopen(VTUN_PID_FILE,"w")) ){ + if( !(f=fopen(pidfile,"w")) ){ vtun_syslog(LOG_ERR,"Can't write PID file"); return; } @@ -273,12 +287,17 @@ static void usage(void) printf("Usage: \n"); printf(" Server:\n"); #ifdef HAVE_WORKING_FORK - printf("\tvtund <-s|-i> [-f file] [-P port] [-L local address]\n"); + printf("\tvtund <-s|-i> [-f file] [-P port] [-L local address] [-e] [-z pid_file ]\n"); #else - printf("\tvtund <-i> [-f file] [-P port] [-L local address]\n"); + printf("\tvtund <-i> [-f file] [-P port] [-L local address] [-e]\n"); #endif printf(" Client:\n"); /* I don't think these work. I'm disabling the suggestion - bish 20050601*/ +#ifdef HAVE_WORKING_FORK printf("\tvtund [-f file] " /* [-P port] [-L local address] */ - "[-q] [-p] [-m] [-t timeout] \n"); + "[-q] [-p] [-m] [-t timeout] [-e] \n"); +#else + printf("\tvtund [-f file] " /* [-P port] [-L local address] */ + "[-q] [-p] [-m] [-t timeout] [-e] \n"); +#endif } Index: head/net/vtun/files/patch-vtund.8 =================================================================== --- head/net/vtun/files/patch-vtund.8 (revision 517564) +++ head/net/vtun/files/patch-vtund.8 (revision 517565) @@ -1,30 +1,33 @@ ---- vtund.8.orig 2016-09-17 13:01:21.000000000 -0700 -+++ vtund.8 2016-09-19 20:38:04.531515000 -0700 -@@ -48,6 +48,12 @@ +Part of extended mode being an argument and not a compile time decision. +Some bits about using vfork, or not, and pidfile as an argument. + +--- vtund.8.orig 2016-09-17 20:01:21 UTC ++++ vtund.8 +@@ -48,6 +48,12 @@ vtund \- VTun(Virtual Tunnel) daemon. [ .I -n ] +[ +.I -e +] +[ +.I -s pid_file +] < .I session > -@@ -116,6 +122,14 @@ +@@ -115,6 +121,14 @@ Connect + .I timeout Default is 30 seconds. This options is equivalent to the 'timeout' option of config file. - .TP ++.TP +.I -e +Use vtun-v6 extended mode. +.TP +.I -z pid_file +Connect +.I z pid_file +The full pathname of the file containing the PID of the daemon in server mode. -+.TP + .TP .I session Session name from the config file. - .TP