Bug 96263 - port update: net/bounce . bind outgoing connection
Summary: port update: net/bounce . bind outgoing connection
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Pav Lucistnik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-24 14:20 UTC by SeaD
Modified: 2006-07-04 15:49 UTC (History)
1 user (show)

See Also:


Attachments
file.shar (7.69 KB, text/plain)
2006-04-24 14:20 UTC, SeaD
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description SeaD 2006-04-24 14:20:09 UTC
Small port update.
Comment 1 Volker Stolz freebsd_committer freebsd_triage 2006-04-25 12:30:39 UTC
State Changed
From-To: open->feedback

Could you please provide the update in the form of a unified diff as 
described in the Porters Handbook?
Comment 2 SeaD 2006-04-28 12:26:44 UTC
>Submitter-Id:  current-users
>Originator:    SeaD
>Organization:
>Confidential:  no
>Synopsis:      port update: net/bounce . bind outgoing connection
>Severity:      non-critical
>Priority:      low
>Category:      ports
>Class:         update
>Release:       FreeBSD 6.0-RELEASE-p3 i386
>Environment:
System: FreeBSD newcom.perm.ws 6.0-RELEASE-p3 FreeBSD 6.0-RELEASE-p3 #2: Mon Feb 27 19:34:42 YEKT 2006 sead@newcom.perm.ws:/usr/obj/usr/src/sys/KNEWCOM i386


>Description:

Small port update.

Added file: bounce/files/patch-02

>How-To-Repeat:
>Fix:

diff -ruN bounce.old/files/patch-02 bounce/files/patch-02
--- bounce.old/files/patch-02   Thu Jan  1 03:00:00 1970
+++ bounce/files/patch-02       Fri Apr 28 14:48:27 2006
@@ -0,0 +1,21 @@
+--- bounce.c.orig      Wed Mar 15 13:21:58 2006
++++ bounce.c   Fri Mar 31 17:58:08 2006
+@@ -220,6 +220,7 @@
+         exit(-1);
+     }
+     listen(srv_fd,QLEN);
++    srv_addr.sin_port=0;
+
+     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 */
+           if ((cl_fd=socket(PF_INET, SOCK_STREAM, 0))<0) {
++              close(rem_fd);
++              exit(-1);
++          }
++          if (bind(cl_fd,(struct sockaddr *)&srv_addr,sizeof(srv_addr))<0) {
+               close(rem_fd);
+               exit(-1);
+           }
Comment 3 Volker Stolz freebsd_committer freebsd_triage 2006-04-28 12:41:36 UTC
State Changed
From-To: feedback->open

Feedback recvd
Comment 4 Pav Lucistnik freebsd_committer freebsd_triage 2006-04-29 13:55:45 UTC
State Changed
From-To: open->feedback

Can you briefly describe, what this new patch file is changing? 


Comment 5 Pav Lucistnik freebsd_committer freebsd_triage 2006-04-29 13:55:45 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pav

Track
Comment 6 SeaD 2006-05-02 06:23:31 UTC
Its just simple bind() for outgoing connection. Nothing more.
Previous patch from scot@poptart.org added -a option for
listen on single local address and my patch adds
bind() to outgoing redirected connection too. So you can
make redirect from one specified address.

-- 
SeaD <sead@deep.perm.ru>
fp: DC8C 6973 59DE 5580 FDF6 3153 005C 0156
Comment 7 Pav Lucistnik freebsd_committer freebsd_triage 2006-05-02 09:31:16 UTC
State Changed
From-To: feedback->closed

Committed, thanks!
Comment 8 SeaD 2006-06-02 09:40:54 UTC
>Submitter-Id:  current-users
>Originator:    SeaD
>Organization:
>Confidential:  no
>Synopsis:      port update: net/bounce . bind outgoing connection/update
>Severity:      non-critical
>Priority:      low
>Category:      ports
>Class:         update
>Release:       FreeBSD 6.0-RELEASE-p3 i386
>Environment:
System: FreeBSD newcom.perm.ws 6.0-RELEASE-p3 FreeBSD 6.0-RELEASE-p3 #2: Mon Feb 27 19:34:42 YEKT 2006 sead@newcom.perm.ws:/usr/obj/usr/src/sys/KNEWCOM i386


>Description:

Update for update.

Added new option -b for outgoing binding.
-a option works as before my patch.

Suggested by Alexander Logvinov

>How-To-Repeat:
>Fix:


diff -ruN bounce.orig/Makefile bounce/Makefile
--- bounce.orig/Makefile        Fri Jun  2 13:51:12 2006
+++ bounce/Makefile     Fri Jun  2 14:08:05 2006
@@ -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 -ruN bounce.orig/files/patch-02 bounce/files/patch-02
--- bounce.orig/files/patch-02  Tue May  2 14:31:07 2006
+++ bounce/files/patch-02       Fri Jun  2 13:25:36 2006
@@ -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) {
Comment 9 Pav Lucistnik freebsd_committer freebsd_triage 2006-06-04 15:38:33 UTC
State Changed
From-To: closed->open

Reopen
Comment 10 Pav Lucistnik freebsd_committer freebsd_triage 2006-06-04 15:54:59 UTC
Dear maintainer of FreeBSD port net/bounce, please take a look at

http://www.freebsd.org/cgi/query-pr.cgi?q=96263

on the followup sent on Friday, June the 2nd.

Do you approve this update?

-- 
Pav Lucistnik <pav@oook.cz>
              <pav@FreeBSD.org>

Cats happen.
Comment 11 Pav Lucistnik freebsd_committer freebsd_triage 2006-06-04 16:15:57 UTC
State Changed
From-To: open->feedback

Asked maintainer for approval
Comment 12 matt wilbur 2006-06-06 18:31:45 UTC
Yes, looks good to me..

Thanks
matt 

-----Original Message-----
From: Pav Lucistnik [mailto:pav@FreeBSD.org] 
Sent: Sunday, June 04, 2006 7:55 AM
To: bug-followup@FreeBSD.org; matt@efs.org
Subject: Re: ports/96263: port update: net/bounce . bind outgoing connection

Dear maintainer of FreeBSD port net/bounce, please take a look at

http://www.freebsd.org/cgi/query-pr.cgi?q=96263

on the followup sent on Friday, June the 2nd.

Do you approve this update?

--
Pav Lucistnik <pav@oook.cz>
              <pav@FreeBSD.org>

Cats happen.
Comment 13 Pav Lucistnik freebsd_committer freebsd_triage 2006-06-07 19:23:16 UTC
State Changed
From-To: feedback->open

Approved
Comment 14 Pav Lucistnik freebsd_committer freebsd_triage 2006-06-07 19:23:26 UTC
State Changed
From-To: open->feedback

Does not patch; can you resend?
Comment 15 Pav Lucistnik freebsd_committer freebsd_triage 2006-07-04 15:49:43 UTC
State Changed
From-To: feedback->closed

Committed, thanks!