Index: head/net/vtun/Makefile =================================================================== --- head/net/vtun/Makefile (revision 491099) +++ head/net/vtun/Makefile (revision 491100) @@ -1,58 +1,58 @@ # Created by: Kevin Lo # $FreeBSD$ PORTNAME= vtun PORTVERSION= 3.0.4 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= net MASTER_SITES= SF MAINTAINER= mat@FreeBSD.org COMMENT= Virtual Tunnels over TCP/IP networks with traffic shaping 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 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 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} .for doc in ${DOCS} @${INSTALL_DATA} ${WRKSRC}/${doc} ${STAGEDIR}${DOCSDIR} .endfor @cd ${STAGEDIR}${PREFIX}/man/man1/ && \ ${LN} -s vtund.8 ../man1/vtun.1 .include Index: head/net/vtun/files/patch-main.c =================================================================== --- head/net/vtun/files/patch-main.c (revision 491099) +++ head/net/vtun/files/patch-main.c (revision 491100) @@ -1,64 +1,79 @@ ---- main.c.orig 2013-07-07 13:31:22.000000000 -0700 -+++ main.c 2016-09-19 20:32:29.072400000 -0700 +--- 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 @@ +@@ -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 @@ +@@ -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); -@@ -250,7 +261,7 @@ +@@ -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 +284,12 @@ +@@ -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 }