Date: Mon, 3 Oct 2005 14:53:24 +0100 From: Ceri Davies <ceri@submonkey.net> To: Gleb Smirnoff <glebius@FreeBSD.org> Cc: net@FreeBSD.org Subject: Re: ng_tee, right2left, et al Message-ID: <20051003135324.GH56760@submonkey.net> In-Reply-To: <20051003134132.GE73935@cell.sick.ru> References: <20051003130731.GF56760@submonkey.net> <20051003134132.GE73935@cell.sick.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
--ULyIDA2m8JTe+TiX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 03, 2005 at 05:41:32PM +0400, Gleb Smirnoff wrote: Hi Gleb, > 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 ha= ve > C> just started reading the docs whilst paying proper attention. I start= ed > C> out with ng_tee as it looked the simplest, but I've found myself > C> confused already. > C>=20 > C> The manpage for ng_tee says: > C>=20 > 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>=20 > C> Packets may also be received on right2left and left2right; if so, they > C> are forwarded unchanged out hooks right and left, respectively. > C>=20 > 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 sho= ws > 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>=20 > C> Is this behaviour that was changed for some reason, or has it always > C> been "wrong"? >=20 > 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 o= f the > node" will be forwarded to hook left. I only call it "wrong" as it didn't agree with Archie's article or my expectations, hence the quotes - I realise that it's subjective. It just seems to me that packets leaving left2right would go to right, as the name implies. I don't really mind either way, it's simply that I found it confusing. > I've checked Archie's article. What is said here is not true nowadays. Yo= u 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. Ho= wever, > I agree with him. The current behavior is more intuitive. Perhaps as I learn more about it I will come to agree ;-) Thanks. Ceri --=20 Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. -- Einstein (attrib.) --ULyIDA2m8JTe+TiX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDQTfUocfcwTS3JF8RAuvLAKCMvex6HAO3QGE/KrL5zojd0EG/8ACgnf54 Fy1kTWVdVKRcl6mLhG38LTU= =7q6h -----END PGP SIGNATURE----- --ULyIDA2m8JTe+TiX--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051003135324.GH56760>