Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Aug 2004 13:28:25 +0200 (CEST)
From:      Helge Oldach <datapipeaug04@oldach.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        roam@FreeBSD.org
Subject:   ports/70205: ports/net/datapipe shouldn't bind to listen address (with patch)
Message-ID:  <200408091128.i79BSPZS044279@sep.oldach.net>
Resent-Message-ID: <200408091130.i79BUNcA085029@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         70205
>Category:       ports
>Synopsis:       ports/net/datapipe shouldn't bind to listen address (with patch)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 09 11:30:23 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Helge Oldach
>Release:        FreeBSD 4.10-STABLE i386
>Organization:
>Environment:
System: FreeBSD localhost 4.10-STABLE FreeBSD 4.10-STABLE #1945: Sun Aug 1 13:39:01 CEST 2004 toor@localhost:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:

ports/net/datapipe is currently using the address it listens on as the
address for outgoing connections. This is a problem for multi-homed
hosts, where the outgoing address normally should be assigned according
to the routing table.

For example consider a multi-homed host with interfaces 10.0.0.1/24 and
10.1.1.1/24

	datapipe 10.0.0.1 100 10.1.1.219 100

would listen on 10.0.0.1 and forward incoming sessions to host
10.1.1.219, using the source address 10.0.0.1 for the forwarded TCP
session. It should however use the address of the outgoing interface,
that is 10.1.1.1.

	
>How-To-Repeat:
	
>Fix:

	
--- datapipe.c.ORIG	Tue Jan  4 07:48:55 2000
+++ datapipe.c	Mon Aug  9 13:10:56 2004
@@ -164,9 +164,10 @@
   }
 
 
-  /* change the port in the listener struct to zero, since we will
-   * use it for binding to outgoing local sockets in the future. */
+  /* change the port and address in the listener struct to zero, since we will
+   * use it for binding to outgoing local sockets and address in the future. */
   laddr.sin_port = htons(0);
+  laddr.sin_addr.s_addr = INADDR_ANY;
 
 
   /* fork off into the background. */

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200408091128.i79BSPZS044279>