From owner-freebsd-current Fri Apr 30 11:20:24 1999 Delivered-To: freebsd-current@freebsd.org Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (Postfix) with ESMTP id 7AAEB14DD6 for ; Fri, 30 Apr 1999 11:20:21 -0700 (PDT) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.9.3/8.9.1) with ESMTP id LAA14777; Fri, 30 Apr 1999 11:20:20 -0700 (PDT) (envelope-from jdp@polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.9.3/8.9.1) id LAA15946; Fri, 30 Apr 1999 11:20:19 -0700 (PDT) (envelope-from jdp@polstra.com) Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <199904301809.LAA25759@GndRsh.aac.dev.com> Date: Fri, 30 Apr 1999 11:20:19 -0700 (PDT) Organization: Polstra & Co., Inc. From: John Polstra To: "Rodney W. Grimes" Subject: Re: Any action on PR 10570 ? getting closer to 65K :-( Cc: freebsd-current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Rodney W. Grimes wrote: >> Pierre Beyssac wrote: >> >> > Wouldn't it be sensible to issue a warning (or panic) when >> > increasing the reference count reaches 0, rather than causing a >> > later kernel segfault? It would involve some overhead though, and >> > I'm not sure having 2^32 routes is currently realistic since most >> > machines don't even have that many bytes of RAM, but it might be >> > true one day... >> >> It would be pretty hard to create 2^32 routes, given that IPv4 only >> has 32-bit addresses. :-) Also, if you time it I suspect you'll find >> that it would take a geological lifetime on a fast machine to add that >> many routes. > > But some of us are playing with IPv6 and it is easy to create >2^32 > routes in that environment. You're being totally unrealistic. You can't create >2^32 of _anything_ on an i386 without running out of memory. Even if you could address that much memory, you or your machine would be dead from old age long before it managed to add that many routes. Let's say, _totally_ unrealistically, that you added 100 routes per second continuously. It would still take you 500 days to wrap the 32-bit counter. Regarding IPv6, it would be a surprise if that structure remained the same at all for IPv6. > The checks could be added _today_ with very little testing needed, > simple return an error if attempting to wrap the route ref count > from 65536->0. At least then we don't blow chunks latter and end > up segfaulting. > > This is a real bug fix. No it's not. It doesn't fix anything, because your 16-bit counter has wrapped around and now it's not valid any more. It doesn't matter whether you detect it and warn about it or not. The damage is already done. On the other hand, increasing the size of the variable eliminates the problem entirely. And once you do that, the overflow test is unnecessary. John --- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-interest is the aphrodisiac of belief." -- James V. DeLong To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message