From owner-freebsd-hackers Mon Dec 8 12:24:56 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id MAA06993 for hackers-outgoing; Mon, 8 Dec 1997 12:24:56 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id MAA06970 for ; Mon, 8 Dec 1997 12:24:46 -0800 (PST) (envelope-from archie@whistle.com) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id MAA26271; Mon, 8 Dec 1997 12:24:16 -0800 (PST) Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3) id sma026269; Mon Dec 8 12:24:08 1997 Received: (from archie@localhost) by bubba.whistle.com (8.8.5/8.6.12) id MAA11047; Mon, 8 Dec 1997 12:24:08 -0800 (PST) From: Archie Cobbs Message-Id: <199712082024.MAA11047@bubba.whistle.com> Subject: Re: help: divert sockets question In-Reply-To: <199712081612.SAA11172@relay.ucb.crimea.ua> from Ruslan Ermilov at "Dec 8, 97 06:12:49 pm" To: ru@ucb.crimea.ua (Ruslan Ermilov) Date: Mon, 8 Dec 1997 12:24:08 -0800 (PST) Cc: fwang2@unity.ncsu.edu, hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Ruslan Ermilov writes: > I did it the same way. It doesn't work for me ;-( > > In general, I have a packet received trhu udp from remote machine, > and I need to write it as incoming on a local machine. > > Usually, you read the packet from divert socket first using recvfrom(), > then optionally modify it, and then write it back using sendto(). > > My case is differ, because I just need to write a packet as incoming, > not reading it from divert socket first. Make sure you're recomputing the checksum properly, etc. You might also try to check the kernel statistics and the ipfw log (turn on ipfw logging on all rejected packets) to see why the packet is being dropped. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com