From owner-cvs-all Mon May 25 12:26:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA18790 for cvs-all-outgoing; Mon, 25 May 1998 12:26:07 -0700 (PDT) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA18597; Mon, 25 May 1998 12:25:44 -0700 (PDT) (envelope-from julian@whistle.com) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id MAA29509; Mon, 25 May 1998 12:18:12 -0700 (PDT) Received: from current1.whistle.com(207.76.205.22) via SMTP by alpo.whistle.com, id smtpd029504; Mon May 25 19:18:04 1998 Date: Mon, 25 May 1998 12:18:00 -0700 (PDT) From: Julian Elischer To: Luigi Rizzo cc: Julian Elischer , cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-sys@FreeBSD.ORG Subject: Re: cvs commit: src/sys/conf options src/sys/netinet ip_divert.c In-Reply-To: <199805251216.OAA20496@labinfo.iet.unipi.it> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk On Mon, 25 May 1998, Luigi Rizzo wrote: > > The new semantic (which is how we should have done it the first time) > > is that the port number in the sendto() is the rule number AFTER which > > processing should restart, and on a recvfrom(), the port number is the > > rule number which caused the diversion. This is much more flexible, > > and also more intuitive. If the user uses the same sockaddr received > > for sure it is more flexible, but to me it is not that intuitive to > mix port and rule numbers. What about your original idea (that i > implemented in dummynet) of adding a field to the m_pkthdr so that you > can carry around a pointer to the matching rule and be able to do the > right thing later on the packet ? Actually that was your interpretation of two different ideas merged together.. :-) I always intended to redo the 'reinjection' semantic this way. In my opinion there should be no state within the kernel that is relied on by the diverting daemon to reinject it's packets back to where they should go. The diverting daemon should be able to fabricate and inject packets that have never been diverted, as part of it's task. Using an extra field in the mbuf to hold a reference to a rule is only a way of getting rid of the horrible global variables. It also gives you a place to pass out 'flow' information to (say) ALTQ. The main part of this change was to change what the number passed back DOES. I didn't want to change too many things at once. Just because I did this doesn't mean I'm not going to dop other things as well :-) for example the SKIPTO optimisation you did will probably make it in in the next day or so. > > (BTW the divert hack, i never fully understood if/how it works in case > the processing for a diverted packet is suspended, or multiple copies > of the packet are generated -- since there is > only one state variable for this purpose). DIVERT packets are totally asynchronous. you may pass out 1200 packets and only get the first one back after the last one goes out, or you may get totally fabricated packets. The daemon may decide to arbitrarily discard a packet. This is why there must be no held state in the kernel and injected packets must not require some state in the kernel. This is why all you can do is specify a rule number to start after. It will always succeed. > This is a problem in dummynet, but i wonder if it also has some > interaction with TEE rules or multicast traffic. > > cheers > luigi > -----------------------------+-------------------------------------- > Luigi Rizzo | Dip. di Ingegneria dell'Informazione > email: luigi@iet.unipi.it | Universita' di Pisa > tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) > fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ > _____________________________|______________________________________ > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message