Module: kamailio
Branch: master
Commit: 46b10dfe1941ab70676a10d5f61d749fd74dfa3c
URL:
https://github.com/kamailio/kamailio/commit/46b10dfe1941ab70676a10d5f61d749…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-12-28T23:19:14+01:00
permissions: max_subnets - new parameter
- specify the max size for address subnets array
- default value: 512
- if there are more subnet records in address tables than the value of
max_subnets, increase it
---
Modified: modules/permissions/hash.c
Modified: modules/permissions/hash.h
Modified: modules/permissions/permissions.c
---
Diff:
https://github.com/kamailio/kamailio/commit/46b10dfe1941ab70676a10d5f61d749…
Patch:
https://github.com/kamailio/kamailio/commit/46b10dfe1941ab70676a10d5f61d749…
---
diff --git a/modules/permissions/hash.c b/modules/permissions/hash.c
index 2aee8b8..cfc81fe 100644
--- a/modules/permissions/hash.c
+++ b/modules/permissions/hash.c
@@ -44,6 +44,9 @@ static int_str tag_avp;
extern int peer_tag_mode;
+extern int _perm_max_subnets;
+
+#define PERM_MAX_SUBNETS _perm_max_subnets
/*
* Parse and set tag AVP specs
diff --git a/modules/permissions/hash.h b/modules/permissions/hash.h
index cfb6813..0ae7854 100644
--- a/modules/permissions/hash.h
+++ b/modules/permissions/hash.h
@@ -176,8 +176,6 @@ int addr_hash_table_rpc_print(struct addr_list** table, rpc_t* rpc,
void* c);
void empty_addr_hash_table(struct addr_list** hash_table);
-#define PERM_MAX_SUBNETS 512
-
/*
* Structure used to store a subnet
diff --git a/modules/permissions/permissions.c b/modules/permissions/permissions.c
index 724e4e8..f4133f6 100644
--- a/modules/permissions/permissions.c
+++ b/modules/permissions/permissions.c
@@ -88,6 +88,8 @@ str port_col = str_init("port"); /* Name of port
column */
static int check_all_branches = 1;
+int _perm_max_subnets = 512;
+
/*
* Convert the name of the files into table index
*/
@@ -178,6 +180,7 @@ static param_export_t params[] = {
{"ip_addr_col", PARAM_STR, &ip_addr_col },
{"mask_col", PARAM_STR, &mask_col },
{"port_col", PARAM_STR, &port_col },
+ {"max_subnets", PARAM_INT, &_perm_max_subnets },
{0, 0, 0}
};