diff --git a/net/bounce/Makefile b/net/bounce/Makefile index 8f3ab3353022..49573dccb7c2 100644 --- a/net/bounce/Makefile +++ b/net/bounce/Makefile @@ -8,7 +8,7 @@ PORTNAME= bounce PORTVERSION= 1.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net security MASTER_SITES= http://www.iagora.com/~espel/ \ ${MASTER_SITE_LOCAL} diff --git a/net/bounce/files/patch-02 b/net/bounce/files/patch-02 index 01f9479a92ba..21953e7e4db4 100644 --- a/net/bounce/files/patch-02 +++ b/net/bounce/files/patch-02 @@ -1,6 +1,35 @@ ---- bounce.c.orig Tue May 2 10:14:42 2006 -+++ bounce.c Tue May 2 10:16:02 2006 -@@ -220,6 +220,7 @@ +--- bounce.c.orig Fri Jun 2 12:58:37 2006 ++++ bounce.c Fri Jun 2 13:25:28 2006 +@@ -138,7 +138,7 @@ + } + + int main(int argc,char *argv[]) { +- int srv_fd, rem_fd, len, cl_fd, on=1; ++ int srv_fd, rem_fd, len, cl_fd, on=1, b=0; + int myport=DEFAULT_PORT, remoteport; + struct sockaddr_in rem_addr, srv_addr, cl_addr; + char *myname; +@@ -153,8 +153,9 @@ + + /* Process arguments */ + +- while( (ch = getopt(argc, argv, "p:a:")) != -1 ) { ++ while( (ch = getopt(argc, argv, "p:a:b:")) != -1 ) { + switch(ch) { ++ case 'b': b = 1; + case 'a': + hostname = malloc( strlen(optarg) + 1); + if( !hostname ) { +@@ -177,7 +178,7 @@ + argv += optind; + + if (argc!=2) { +- fprintf(stderr,"Use: %s [-a localaddr] [-p localport] machine port \n",myname); ++ fprintf(stderr,"Use: %s [-a localaddr | -b localaddr] [-p localport] machine port \n",myname); + exit(-1); + } + if ((remoteport=atoi(argv[1]))<=0) { +@@ -220,6 +221,7 @@ exit(-1); } listen(srv_fd,QLEN); @@ -8,14 +37,16 @@ signal(SIGCHLD, sigchld); printf("Ready to bounce connections from port %i to %s on port %i\n", -@@ -252,6 +253,10 @@ - default: /* parent process */ - close(srv_fd); /* close original socket */ +@@ -254,6 +256,12 @@ if ((cl_fd=socket(PF_INET, SOCK_STREAM, 0))<0) { + close(rem_fd); + exit(-1); ++ } ++ if (b) { ++ if (bind(cl_fd,(struct sockaddr *)&srv_addr,sizeof(srv_addr))<0) { + close(rem_fd); + exit(-1); + } -+ if (bind(cl_fd,(struct sockaddr *)&srv_addr,sizeof(srv_addr))<0) { - close(rem_fd); - exit(-1); } + if (connect(cl_fd, (struct sockaddr *)&cl_addr, + sizeof(cl_addr))<0) {