From owner-freebsd-net@FreeBSD.ORG Mon Oct 3 13:41:37 2005 Return-Path: X-Original-To: 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 2A4B816A420 for ; Mon, 3 Oct 2005 13:41:37 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 89DC243D48 for ; Mon, 3 Oct 2005 13:41:35 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.13.3/8.13.3) with ESMTP id j93DfW0g074597 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Oct 2005 17:41:33 +0400 (MSD) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.3/8.13.1/Submit) id j93DfWqx074596; Mon, 3 Oct 2005 17:41:32 +0400 (MSD) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 3 Oct 2005 17:41:32 +0400 From: Gleb Smirnoff To: Ceri Davies , net@FreeBSD.org Message-ID: <20051003134132.GE73935@cell.sick.ru> References: <20051003130731.GF56760@submonkey.net> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20051003130731.GF56760@submonkey.net> User-Agent: Mutt/1.5.6i Cc: Subject: Re: ng_tee, right2left, et al 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: Mon, 03 Oct 2005 13:41:37 -0000 Ceri, On Mon, Oct 03, 2005 at 02:07:31PM +0100, Ceri Davies wrote: C> I've discovered an application for which netgraph looks perfect, so have C> just started reading the docs whilst paying proper attention. I started C> out with ng_tee as it looked the simplest, but I've found myself C> confused already. C> C> The manpage for ng_tee says: C> C> Tee nodes have four hooks, right, left, right2left, and left2right. C> All data received on right is sent unmodified to both hooks left and C> right2left. Similarly, all data received on left is sent unmodified C> to both right and left2right. C> C> Packets may also be received on right2left and left2right; if so, they C> are forwarded unchanged out hooks right and left, respectively. C> C> Now that last bit looked wrong to me; I would have though that a packet C> received on right2left would be copied to left. Checking the code shows C> that the manpage is correct, though Archie Cobbs' article at C> http://ezine.daemonnews.org/200003/netgraph.html says that the opposite C> is true. C> C> Is this behaviour that was changed for some reason, or has it always C> been "wrong"? I don't understand why you call current behavior wrong. I think that this is intuitive, that any packet received on "left side of the node" will be forwarded to hook right. As well as any packets received on "right side of the node" will be forwarded to hook left. I've checked Archie's article. What is said here is not true nowadays. You are right, before revision 1.17 of ng_tee.c the node treated l2r and r2l hooks counterwise. There is no comment, why Julian has changed the behavior. However, I agree with him. The current behavior is more intuitive. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE