diff options
author | Chion Tang <sdspeedonion@gmail.com> | 2018-01-21 08:33:14 +0000 |
---|---|---|
committer | Chion Tang <sdspeedonion@gmail.com> | 2018-01-21 08:33:14 +0000 |
commit | b31b29638b4acf45b873a113d6470203d7172e18 (patch) | |
tree | 4055f69edaaf26137edcaae9002b82aa1b07960c | |
parent | Modify README (diff) | |
download | netfilter-full-cone-nat-b31b29638b4acf45b873a113d6470203d7172e18.tar.gz netfilter-full-cone-nat-b31b29638b4acf45b873a113d6470203d7172e18.tar.bz2 netfilter-full-cone-nat-b31b29638b4acf45b873a113d6470203d7172e18.zip |
fix: avoid sleep while kmalloc
-rw-r--r-- | xt_FULLCONENAT.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xt_FULLCONENAT.c b/xt_FULLCONENAT.c index 5cadea2..c47b2f9 100644 --- a/xt_FULLCONENAT.c +++ b/xt_FULLCONENAT.c @@ -35,7 +35,7 @@ static struct natmapping* get_mapping(const uint16_t port) { prev = p_current; p_current = p_current->next; } - new = kmalloc(sizeof(struct natmapping), GFP_KERNEL); + new = kmalloc(sizeof(struct natmapping), GFP_ATOMIC); if (new == NULL) { return NULL; } @@ -50,7 +50,7 @@ static struct natmapping* get_mapping(const uint16_t port) { } static void init_mappings(void) { - mappings_head = kmalloc(sizeof(struct natmapping), GFP_KERNEL); + mappings_head = kmalloc(sizeof(struct natmapping), GFP_ATOMIC); if (mappings_head != NULL) { mappings_head->next = NULL; mappings_head->port = 0; |