X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=dummynet%2Finclude%2Fsys%2Fmalloc.h;h=b6c4ac5ba913816ffdcb8f5edabf06d57e0483b9;hb=6c2e192c3237bd46db6ad4230fed71d28f362331;hp=03b9dfbf31b98fa3cf90f80ab48399dcfbb0e432;hpb=5f337135c613b2ee3cb24ade7617ecaae0a74681;p=ipfw.git diff --git a/dummynet/include/sys/malloc.h b/dummynet/include/sys/malloc.h index 03b9dfb..b6c4ac5 100644 --- a/dummynet/include/sys/malloc.h +++ b/dummynet/include/sys/malloc.h @@ -8,9 +8,21 @@ */ #ifndef _WIN32 /* this is the linux version */ +/* + * XXX On zeroshell (2.6.25.17) we get a load error + * __you_cannot_kmalloc_that_much + * which is triggered when kmalloc() is called with a large + * compile-time constant argument (include/linux/slab_def.h) + * + * I think it may be a compiler (or source) bug because there is no + * evidence that such a large request is made. + * Making the _size argument to kmalloc volatile prevents the compiler + * from making the mistake, though it is clearly not ideal. + */ + #if !defined (LINUX_24) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22) #define malloc(_size, type, flags) \ - kmalloc(_size, GFP_ATOMIC | __GFP_ZERO) + ({ volatile int _v = _size; kmalloc(_v, GFP_ATOMIC | __GFP_ZERO); }) #else /* LINUX <= 2.6.22 and LINUX_24 */ /* linux 2.6.22 does not zero allocated memory */ #define malloc(_size, type, flags) \