diff options
author | miwi <miwi@FreeBSD.org> | 2007-06-06 19:24:47 +0800 |
---|---|---|
committer | miwi <miwi@FreeBSD.org> | 2007-06-06 19:24:47 +0800 |
commit | 6711d9d5b1c24a3cf009608d9ffd4795306b7887 (patch) | |
tree | dd7dccea6dfd6c721b590746a897c5590d110523 /net | |
parent | a6bc416636c5f68d51f7edd7faf4da6b1d0186c3 (diff) | |
download | freebsd-ports-gnome-6711d9d5b1c24a3cf009608d9ffd4795306b7887.tar.gz freebsd-ports-gnome-6711d9d5b1c24a3cf009608d9ffd4795306b7887.tar.zst freebsd-ports-gnome-6711d9d5b1c24a3cf009608d9ffd4795306b7887.zip |
- Add new -d option to call gethostbyname before connect
PR: 113069
Submitted by: Alexander Logvinov <ports@logvinov.com>
Approved by: maintainer
Diffstat (limited to 'net')
-rw-r--r-- | net/bounce/Makefile | 2 | ||||
-rw-r--r-- | net/bounce/files/patch-03 | 44 |
2 files changed, 45 insertions, 1 deletions
diff --git a/net/bounce/Makefile b/net/bounce/Makefile index ac92b62fe3fd..9bac16f1afaa 100644 --- a/net/bounce/Makefile +++ b/net/bounce/Makefile @@ -8,7 +8,7 @@ PORTNAME= bounce PORTVERSION= 1.0 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= net security MASTER_SITES= http://www.iagora.com/~espel/ \ ${MASTER_SITE_LOCAL} diff --git a/net/bounce/files/patch-03 b/net/bounce/files/patch-03 new file mode 100644 index 000000000000..199811db2d05 --- /dev/null +++ b/net/bounce/files/patch-03 @@ -0,0 +1,44 @@ +--- bounce.c.orig Mon May 28 09:07:37 2007 ++++ bounce.c Mon May 28 09:08:41 2007 +@@ -138,7 +138,7 @@ + } + + int main(int argc,char *argv[]) { +- int srv_fd, rem_fd, len, cl_fd, on=1, b=0; ++ int srv_fd, rem_fd, len, cl_fd, on=1, b=0, d=0; + int myport=DEFAULT_PORT, remoteport; + struct sockaddr_in rem_addr, srv_addr, cl_addr; + char *myname; +@@ -153,9 +153,10 @@ + + /* Process arguments */ + +- while( (ch = getopt(argc, argv, "p:a:b:")) != -1 ) { ++ while( (ch = getopt(argc, argv, "p:a:b:d")) != -1 ) { + switch(ch) { + case 'b': b = 1; ++ case 'd': d = 1; break; + case 'a': + hostname = malloc( strlen(optarg) + 1); + if( !hostname ) { +@@ -178,7 +179,7 @@ + argv += optind; + + if (argc!=2) { +- fprintf(stderr,"Use: %s [-a localaddr | -b localaddr] [-p localport] machine port \n",myname); ++ fprintf(stderr,"Use: %s [-a localaddr | -b localaddr] [-p localport] [-d] machine port \n",myname); + exit(-1); + } + if ((remoteport=atoi(argv[1]))<=0) { +@@ -261,6 +262,11 @@ + if (bind(cl_fd,(struct sockaddr *)&srv_addr,sizeof(srv_addr))<0) { + close(rem_fd); + exit(-1); ++ } ++ } ++ if (d) { ++ if ((hp=gethostbyname(argv[0]))!=NULL) { ++ cl_addr.sin_addr=*(struct in_addr *)(hp->h_addr_list[0]); + } + } + if (connect(cl_fd, (struct sockaddr *)&cl_addr, |