I still say the interface is wrong for IPv4 and that you should store precomputed netmasks for IPv4. I'd advocate the same for IPv6 too.
How about a branchless ipv6 check: r = (a[0] - (b[0] & c[0])); r |= (a[1] - (b[1] & c[1])); r |= (a[2] - (b[2] & c[2])); r |= (a[3] - (b[3] & c[3])); ...well, if you dont want to use that for IPsec, I will for ipf :) I should have done it like this long ago but for some reason never arrived at the right solution (instead it does "r |= (a == (b & c))".) What is the benefit of the above vs the while loop? Does the above cost more than the branching? ...I still think the interface design, where you pass in the prefix length and not a mask, is wrong. Why compute it every time and not just once? If you're hunting for the best performance possible, why rule out seperate functions for IPv4 and IPv6? Darren _______________________________________________ perf-discuss mailing list perf-discuss@opensolaris.org