From owner-freebsd-net Tue Apr 17 11: 6:38 2001 Delivered-To: freebsd-net@freebsd.org Received: from zeta.qmw.ac.uk (zeta.qmw.ac.uk [138.37.6.6]) by hub.freebsd.org (Postfix) with ESMTP id 0EBC637B42C; Tue, 17 Apr 2001 11:06:33 -0700 (PDT) (envelope-from d.m.pick@qmw.ac.uk) Received: from xi.css.qmw.ac.uk ([138.37.8.11]) by zeta.qmw.ac.uk with esmtp (Exim 3.16 #1) id 14pZry-0005qP-00; Tue, 17 Apr 2001 19:06:30 +0100 Received: from cgaa180 by xi.css.qmw.ac.uk with local (Exim 1.92 #1) id 14pZry-0002mO-00; Tue, 17 Apr 2001 19:06:30 +0100 X-Mailer: exmh version 2.0.2 2/24/98 To: freebsd-security@FreeBSD.ORG, net@FreeBSD.ORG, provos@OpenBSD.org Subject: Re: non-random IP IDs In-reply-to: Your message of "Tue, 17 Apr 2001 13:45:26 EDT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 17 Apr 2001 19:06:30 +0100 From: David Pick Message-Id: Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > Would it be better to do it as a kernel option? > options IP_RANDOM_IP_ID for instance? I guess the question is, does the > kernel have to do a comparison to the sysctl variable each time? No. *IF* (big if!) something gets notified when a sysctl variable gets changed (and I don't know of this is true) then if can test the variable once and set a *function* variable to one of two functions: one simple and fast, the other complicated and slow. No test needed for every packet. Of course, the overhead of a procedure call might (in the fast case) be more than the overhead of an inline test. So perhaps write it as: if (function variable) { function_varuable(parameter) } else { /* inline code */ } But there a *lots* of other tests per packet - is one more *that* bad? -- David Pick To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message