projects
/
apps
/
pfixtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add 'resource' keeper.
[apps/pfixtools.git]
/
postlicyd
/
iplist.c
diff --git
a/postlicyd/iplist.c
b/postlicyd/iplist.c
index
c2b471b
..
cddc70a
100644
(file)
--- a/
postlicyd/iplist.c
+++ b/
postlicyd/iplist.c
@@
-414,7
+414,7
@@
static void iplist_filter_async(rbl_result_t *result, void *arg)
--async->awaited;
debug("got asynchronous request result for filter %s, rbl %d, still awaiting %d answers",
--async->awaited;
debug("got asynchronous request result for filter %s, rbl %d, still awaiting %d answers",
- filter->name,
result - array_ptr(async->results, 0
), async->awaited);
+ filter->name,
(int)(result - array_ptr(async->results, 0)
), async->awaited);
if (async->awaited == 0) {
filter_result_t res = HTK_FAIL;
if (async->awaited == 0) {
filter_result_t res = HTK_FAIL;
@@
-456,6
+456,10
@@
static filter_result_t iplist_filter(const filter_t *filter, const query_t *quer
bool error = true;
if (parse_ipv4(query->client_address, &end, &ip) != 0) {
bool error = true;
if (parse_ipv4(query->client_address, &end, &ip) != 0) {
+ if (strchr(query->client_address, ':')) {
+ /* iplist only works on IPv4 */
+ return HTK_FAIL;
+ }
warn("invalid client address: %s, expected ipv4",
query->client_address);
return HTK_ERROR;
warn("invalid client address: %s, expected ipv4",
query->client_address);
return HTK_ERROR;
@@
-509,6
+513,7
@@
static void *iplist_context_constructor(void)
static void iplist_context_destructor(void *data)
{
iplist_async_data_t *ctx = data;
static void iplist_context_destructor(void *data)
{
iplist_async_data_t *ctx = data;
+ array_wipe(ctx->results);
p_delete(&ctx);
}
p_delete(&ctx);
}