Dan McDonald wrote:

The critical diffs are in ip_addr_match() itself, a webrev is at <a 
href=http://cr.opensolaris.org/~danmcd/bugfixes/>http://cr.opensolaris.org/~danmcd/bugfixes/</a>
 and any clues are welcome.<br>


Why are you storing the prefix length and not the mask?
Wouldn't it be faster still if the mask was stored in place
of the prefix length so you don't have to lookup the correct
mask every time?

The ip_addr_match() seems to do well for IPv6, but for
IPv4, there's a lot of extra overhead for what can just be:

boolean_t
ip_addr_match_v4(uint32_t addr, uint32_t mask, uint32_t paddr)
{
   return ((addr & mask) == paddr);
}

Darren

_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to