Thread (11 messages) flat view 11 messages, 2 authors, 2015-03-04

Re: [net-next PATCH 0/6] ipv4/fib_trie: Cleanups to prepare for introduction of key vector

From: Alexander Duyck <hidden>
Date: 2015-03-04 18:22:47

On 03/04/2015 09:53 AM, David Miller wrote:
From: Alexander Duyck <redacted>
Date: Wed, 04 Mar 2015 06:51:27 -0800
quoted
If bits can be 32 then idx should be an unsigned long which is 64
bits.
unsigned long is 32-bit on 32-bit platforms
Right, but if unsigned long is 32 bits then usually a pointer is as 
well.  As a result we wouldn't be able to access the upper bits of a 
node with bits == 32 since the size of the tnode would be over 4 * 2^32.

The general idea is the vmalloc should fail when we attempt to allocate 
a bits == 32 tnode on a system w/ only 32b longs.  Then again I think we 
will probably cause a memory corruption on a 32b system since we are 
probably overflowing size_t on the allocation if bits ==32.  I'll have 
to take a look as I believe we are using the offsetof macro and I am not 
sure how that handles a 64b address on a 32b system.

- Alex
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help