mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-08 13:44:56 +02:00
xt_geoip: do not throw a warnings when country database is size 0
This commit is contained in:
@@ -3,6 +3,7 @@ HEAD
|
|||||||
====
|
====
|
||||||
Fixes:
|
Fixes:
|
||||||
- xt_RAWNAT: ensure correct operation in the presence of IPv4 options
|
- xt_RAWNAT: ensure correct operation in the presence of IPv4 options
|
||||||
|
- xt_geoip: do not throw a warnings when country database is size 0
|
||||||
|
|
||||||
|
|
||||||
v2.2 (2013-03-31)
|
v2.2 (2013-03-31)
|
||||||
|
@@ -83,11 +83,19 @@ geoip_add_node(const struct geoip_country_user __user *umem_ptr,
|
|||||||
p->count = umem.count;
|
p->count = umem.count;
|
||||||
p->cc = umem.cc;
|
p->cc = umem.cc;
|
||||||
size = p->count * geoproto_size[proto];
|
size = p->count * geoproto_size[proto];
|
||||||
|
if (size == 0) {
|
||||||
|
/*
|
||||||
|
* Believe it or not, vmalloc prints a warning to dmesg for
|
||||||
|
* zero-sized allocations :-/
|
||||||
|
*/
|
||||||
|
subnet = NULL;
|
||||||
|
} else {
|
||||||
subnet = vmalloc(size);
|
subnet = vmalloc(size);
|
||||||
if (subnet == NULL) {
|
if (subnet == NULL) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto free_p;
|
goto free_p;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (copy_from_user(subnet,
|
if (copy_from_user(subnet,
|
||||||
(const void __user *)(unsigned long)umem.subnets, size) != 0) {
|
(const void __user *)(unsigned long)umem.subnets, size) != 0) {
|
||||||
ret = -EFAULT;
|
ret = -EFAULT;
|
||||||
|
Reference in New Issue
Block a user