From owner-freebsd-net Thu Mar 15 23:56:52 2001 Delivered-To: freebsd-net@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 7385337B718; Thu, 15 Mar 2001 23:56:43 -0800 (PST) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f2G7uRb64573; Fri, 16 Mar 2001 09:56:27 +0200 (EET) (envelope-from ru) Date: Fri, 16 Mar 2001 09:56:27 +0200 From: Ruslan Ermilov To: Nick Rogness Cc: net@FreeBSD.org Subject: Re: natd divert injecting clarifications Message-ID: <20010316095627.C62097@sunbay.com> Mail-Followup-To: Nick Rogness , net@FreeBSD.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from nick@rogness.net on Thu, Mar 15, 2001 at 09:48:24PM -0600 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org [Redirected to -net] On Thu, Mar 15, 2001 at 09:48:24PM -0600, Nick Rogness wrote: > > Just to be sure I have it right. When the kernel diverts the packet to > natd, via ipfw: > > 1) kernel sends packet to natd > 2) natd read() the packet > 3) natd screws with it (changes dest addr,etc) > 4) natd write() the packet > 5) kernel reinjects the packet back into the firewall > > That's what I could get out of divert(4) and some of the natd source. > Bare with me...I'm a novice programmer. > > Is this correct? > Pretty much correct. 1) kernel sends packet to divert socket 2) natd reads from divert socket 3) natd screws with it 4) natd writes the packet to divert socket; the packet is treated as a completely new entity 5) divert socket's output routine reinjects the packet back "into the normal kernel IP packet processing", not into firewall Such questions are best answered on -net Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message