Date: Wed, 24 May 2006 22:26:34 +0200 From: Andre Oppermann <andre@freebsd.org> To: bu7cher@yandex.ru Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, oleg@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/netinet ip_fw.h ip_fw2.c src/sbin/ipfw ipfw.8 ipfw2.c Message-ID: <4474C17A.10604@freebsd.org> In-Reply-To: <44748DF8.000002.11682@camay.yandex.ru> References: <200605241309.k4OD9tex003002@repoman.freebsd.org> <44747A4C.9090800@freebsd.org> <44748DF8.000002.11682@camay.yandex.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
Andrey V. Elsukov wrote: >> Does this accept the packet and untag it at the same time? Wouldn't >> it make more sense to have [tag|untag] as its own operators like >> [allow|deny]? > > Yes, it does (but example is impractical - we don't need tagging or untagging when packet is finally denied). We thought about making [tag|untag] as its own actions like [allow|deny], but decided to implement it as modifiers instead, for two primary reasons: > > 1) Speed. It is faster to match packet with body of only one rule than to do it once more for the same packet in the next rule, only to take action on it. > > 2) Flexibility. We can use modifiers tag/untag with any possible actions, e.g. allow, netgraph, skipto, pipe, ... - not only [allow|deny]. Imagine you have to insert additional tagging rule for any such action looking absolutely the same? And then consider speed of matching. Thus, it is even *looks* more beautiful to write: > > ipfw add 100 netgraph 300 tag 200 ip from host1 to host2 > > for tagging packet with tag 200 and then sending it to netgraph, than to write something like: > > ipfw add 100 tag 200 ip from host1 to host2 > ipfw add 101 netgraph 300 ip from host1 to host2 tagged 200 I understand your rationale. OTOH I think it's a logical blunder and allows some quite confusing rule sets. What I always liked about ipfw was the simple and obvious logic in the statements. Over time it becomes more and more over- loaded with more stuff and also more stuff breaking the beautiful simplicity and clarity the original ipfw design had. ipfw rules used to read like normal sentences and were really simple to write and understand. But then I'm just ranting... To be honest I would prefer to fix the rule evaluation performance problem of ipfw rather than to clutter the original beautiful rule syntax logic. -- Andre
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4474C17A.10604>