From owner-freebsd-net Thu Dec 27 1:40:26 2001 Delivered-To: freebsd-net@freebsd.org Received: from rwcrmhc52.attbi.com (rwcrmhc52.attbi.com [216.148.227.88]) by hub.freebsd.org (Postfix) with ESMTP id 64AB237B405; Thu, 27 Dec 2001 01:40:20 -0800 (PST) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc52.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20011227094020.TNNI6450.rwcrmhc52.attbi.com@InterJet.elischer.org>; Thu, 27 Dec 2001 09:40:20 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id BAA86463; Thu, 27 Dec 2001 01:32:40 -0800 (PST) Date: Thu, 27 Dec 2001 01:32:39 -0800 (PST) From: Julian Elischer To: "Crist J . Clark" Cc: Henry Su , freebsd-net@FreeBSD.ORG Subject: Re: socket call in the kernel In-Reply-To: <20011227012855.F2090@blossom.cjclark.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org yes, but there is no need to change the packet.. fwd will do exactly what he wants as soon as I can get the network topology worked out :-) On Thu, 27 Dec 2001, Crist J . Clark wrote: > On Thu, Dec 27, 2001 at 01:04:25AM -0800, Henry Su wrote: > > Yes, it works: > > > > [00:52:58][root@test2:~]$ telnet 127.0.0.1 8800 > > Trying 127.0.0.1... > > Connected to localhost. > > Escape character is '^]'. > > 12334 > > > > HTTP/1.1 302 Moved > > Date: Thu, 27 Dec 2001 00:53:18 PST > > Location: https://216.69.69.254/cgi-bin/login > > 0 > > > > > > Connection closed by foreign host. > > > > > > I found the problem is that the ipfw forwarding does not change the dst ip > > address, so that my redirection socket server can not read these > > fwd packet (since the dst ip is not correct). The solution can be change > > the ip_fw.c to modify dst ip address for the forwarding packet, but I do > > not know how to do it. It has next_hop for fwd. I do not know how to do > > packet manupunation in ip_fw.c's chk func. > > That's what I figured your problem was, but I never got around to > asking for you to check it. > > 'fwd' rules _deliberately_ do not actually modify any data in the > packet. You are looking for something more like NAT. natd(8) may be > overkill for your needs. There are other, more lightweight TCP > forwarders in the ports collection. > -- > "It's always funny until someone gets hurt. Then it's hilarious." > > Crist J. Clark | cjclark@alum.mit.edu > | cjclark@jhu.edu > http://people.freebsd.org/~cjc/ | cjc@freebsd.org > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message