From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philip Craig Subject: Re: Transparent proxying using REDIRECT Date: Thu, 17 Jul 2003 17:35:49 +1000 Sender: netfilter-admin@lists.netfilter.org Message-ID: <3F1651D5.5060708@snapgear.com> References: <4.2.2.20030717085400.00cb6ac0@vttmail.vtt.fi> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4.2.2.20030717085400.00cb6ac0@vttmail.vtt.fi> Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Mikko Alutoin Cc: netfilter@lists.netfilter.org Mikko Alutoin wrote: > How does the proxy get to know the original destination IP address and > port? By looking into the HTTP-request, perhaps? If so, what if the > application protocol (some other than HTTP) does not contain the > destination URL? Use SO_ORIGINAL_DST, for example: getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, &dst_addr, &addrlen); -- Philip Craig - philipc@snapgear.com - http://www.SnapGear.com SnapGear - Custom Embedded Solutions and Security Appliances