Permit to forward IEEE802.11 Data Packet from kernel space to user space bypass

kernel network stack.
This commit is contained in:
vemax78
2014-06-07 22:37:19 +02:00
parent 92c86462dc
commit 67daa8dcbb
13 changed files with 385 additions and 174 deletions

View File

@ -2,7 +2,8 @@
#define __CAPWAP_ERROR_HEADER__
#define CAPWAP_SUCCESSFUL 0
#define CAPWAP_ASSERT_CONDITION -1
#define CAPWAP_GENERIC_ERROR -1
#define CAPWAP_ASSERT_CONDITION -2
#define CAPWAP_OUT_OF_MEMORY -2
#define CAPWAP_REQUEST_ROOT -3
#define CAPWAP_CRYPT_ERROR -4

View File

@ -495,8 +495,12 @@ int capwap_network_set_pollfd(struct capwap_network* net, struct pollfd* fds, in
int count = 0;
ASSERT(net != NULL);
ASSERT(fds != NULL);
ASSERT(fdscount > 0);
ASSERT(fdscount >= 0);
/* */
if (!fds && fdscount) {
return -1;
}
/* Count the socket */
for (i = 0; i < CAPWAP_MAX_SOCKETS; i++) {
@ -506,6 +510,11 @@ int capwap_network_set_pollfd(struct capwap_network* net, struct pollfd* fds, in
}
}
/* */
if (!fds && !fdscount) {
return (count * 2);
}
/* Check size of fds array */
if (fdscount < (count * 2)) {
return -1;