From owner-freebsd-net@FreeBSD.ORG Tue Jun 7 22:17:27 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 373A016A41C for ; Tue, 7 Jun 2005 22:17:27 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from nic.ach.sch.gr (nic.sch.gr [194.63.238.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 56D1243D48 for ; Tue, 7 Jun 2005 22:17:25 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: (qmail 3933 invoked by uid 207); 7 Jun 2005 22:17:24 -0000 Received: from keramida@freebsd.org by nic by uid 201 with qmail-scanner-1.21 (sophie: 3.04/2.19/3.81. Clear:RC:1(81.186.70.151):. Processed in 0.639113 secs); 07 Jun 2005 22:17:24 -0000 Received: from dialup151.ach.sch.gr (HELO gothmog.gr) ([81.186.70.151]) (envelope-sender ) by nic.sch.gr (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 7 Jun 2005 22:17:23 -0000 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.3/8.13.3) with ESMTP id j57H5wFr002291; Tue, 7 Jun 2005 20:05:58 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.3/8.13.3/Submit) id j57H5wgN002290; Tue, 7 Jun 2005 20:05:58 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Tue, 7 Jun 2005 20:05:58 +0300 From: Giorgos Keramidas To: Christian Kuhtz Message-ID: <20050607170558.GC1811@gothmog.gr> References: <42A5BCEB.8020109@kuhtz.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42A5BCEB.8020109@kuhtz.com> Cc: freebsd-net@freebsd.org Subject: Re: divert sock api q X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2005 22:17:27 -0000 On 2005-06-07 11:27, Christian Kuhtz wrote: > I'm using the DIVERT socket API for a proof of concept lab setup here, > and I could use some help.. > > Two boxes are involved, packets traverse both in series. The first one, > lets call her A, is taking the UDP packet off the wire, inserts a few > bytes after the UDP header, and sticks it back on the wire. The second > machine, lets call her B, grabs the packet as it comes in, strips the > bytes we inserted, and sticks it back on the wire. > > Or so goes the theory. > > What I'm running into is the following.. When I sendto() the modified > frame on A, the size is correctly reported as what the frame was > modified to be. When the frame arrives on B, I only recvfrom() as many > bytes as the virgin packet used to be when it entered A prior to the > modification. Maybe this is a silly question, as it's been a long while since I last worked with DUMMYNET, but are you also updating the IP header ip_len?