The capwap data channel migrated from userspace to kernalspace

This commit is contained in:
vemax78
2014-09-10 21:58:23 +02:00
parent 71006a9121
commit 8d9985fdea
104 changed files with 6967 additions and 4840 deletions

View File

@ -13,7 +13,6 @@
#include "capwap_logging.h"
#include "capwap_error.h"
#define CANARY 0xaaaaaaaa
#define BACKTRACE_BUFFER 256
#ifndef DEBUG_BREAKPOINT
@ -46,8 +45,8 @@ void* capwap_alloc_debug(size_t size, const char* file, const int line) {
exit(CAPWAP_ASSERT_CONDITION);
}
/* Alloc block with memory block and canary */
block = (struct capwap_memory_block*)malloc(sizeof(struct capwap_memory_block) + size + 4);
/* Alloc block with memory block */
block = (struct capwap_memory_block*)malloc(sizeof(struct capwap_memory_block) + size);
if (!block) {
capwap_logging_debug("Out of memory %s(%d)", file, line);
DEBUG_BREAKPOINT();
@ -64,9 +63,6 @@ void* capwap_alloc_debug(size_t size, const char* file, const int line) {
#endif
block->next = g_memoryblocks;
/* Canary */
*((unsigned long*)(((char*)block->item) + block->size)) = CANARY;
g_memoryblocks = block;
return block->item;
@ -98,13 +94,6 @@ void capwap_free_debug(void* p, const char* file, const int line) {
return;
}
/* Check canary */
if (*((unsigned long*)(((char*)block->item) + block->size)) != CANARY) {
capwap_logging_debug("%s(%d): Invalid canary allocted in %s(%d)", file, line, block->file, block->line);
DEBUG_BREAKPOINT();
return;
}
/* Find memory block */
prevblock = NULL;
findblock = g_memoryblocks;