tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: 16 year old bug

On Aug 24, 2010, at 8:53 PM, Matt Thomas wrote:

> On Aug 24, 2010, at 12:25 AM, Joerg Sonnenberger wrote:
>> On Mon, Aug 23, 2010 at 11:21:37PM -0400, Thor Lancelot Simon wrote:
>>> That's silly.  A bitmask is a bitmask, and there's nothing magical or
>>> difficult about masked compare.  Even the bug OpenBSD just fixed -- now
>>> that it basically doesn't matter any more -- is hardly complex nor is
>>> the fix so.
>> The issue with non-cont netmask is that it dramatically complicates the
>> lookup code. I'd say that at least 1/3 of the radix tree implementation
>> is just related to this "feature".
> Even worse, it's inefficient on newer hardware.  Most platforms have a
> count-leading operation which dramatically increases the lookups.  Also
> knowing the datatype and using datatype specific comparison speeds it
> up even more.
> I've been removing the use of radix and switching to ptree in the network
> rework.


I've never met anyone involved in protocol design or network stack 
implementation who considered non-contiguous netmasks as anything other than a 
bizarre mistake that was corrected many years ago (assuming they have even 
heard of it in the first place).

It does no harm to keep the code around if it doesn't get in the way.  But to 
treat it as anything more than an amusing historic artifact it seriously 
misguided.  And if it stands in the way of anything even remotely important -- 
like maintainability, performance, or the like -- it should be unceremoniously 


Home | Main Index | Thread Index | Old Index