Re: [PATCH 017/103] netfilter: xtables: use better unconditional check

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

 



Jan Engelhardt wrote:
> On Monday 2009-08-10 10:54, Patrick McHardy wrote:
>> Jan Engelhardt wrote:
>>> The use of memcmp should enable architecture-preferred comparison
>>> methods, for example 64-bit comparisons that would complete in [more
>>> than] half the time than inspecting just each u32/char.
>> I don't object to the change as cleanup, but that reasoning makes
>> no sense. memcmp can't assume alignment,
> 
> Right, memcmp itself cannot, and there is usually a prealignment check
> in libcs that clears a few bytes and advances the pointer until it is
> aligned.
> 
>> so unless there's a
>> version checking for compile-time known alignment, this won't happen.
> 
> 	static void func(int r)
> 	{
> 		static int q = 1234;
> 		memcmp(&q, &r, sizeof(q));
> 	}
> 
> There is GCC's __builtin_memcmp, which should generally have
> knowledge about alignment. q and r are known here.

Good point. I was just looking at the kernel provided implementations.

> 
>> Please fix up the changelog and label this as cleanup.
> 
> Will do.
> 

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux