Date: Mon, 28 May 2007 09:32:13 +1000 (YAKST) From: Alexander Logvinov <ports@logvinov.com> To: FreeBSD-gnats-submit@FreeBSD.org Cc: matt@efs.org Subject: ports/113069: [PATCH] net/bounce: add new -d option Message-ID: <200705272332.l4RNWDSh098607@blg.akavia.ru> Resent-Message-ID: <200705272340.l4RNe5sh083883@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 113069 >Category: ports >Synopsis: [PATCH] net/bounce: add new -d option >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sun May 27 23:40:04 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Alexander Logvinov >Release: FreeBSD 6.2-RELEASE-p5 i386 >Organization: >Environment: >Description: Add new -d option to call gethostbyname before connect >How-To-Repeat: >Fix: Index: Makefile =================================================================== RCS file: /home/pcvs/ports/net/bounce/Makefile,v retrieving revision 1.21 diff -u -r1.21 Makefile --- Makefile 10 Nov 2006 00:44:59 -0000 1.21 +++ Makefile 27 May 2007 23:05:47 -0000 @@ -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} Index: files/patch-03 =================================================================== RCS file: files/patch-03 diff -N files/patch-03 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-03 27 May 2007 23:08:47 -0000 @@ -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, >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705272332.l4RNWDSh098607>