aboutsummaryrefslogtreecommitdiffstats
path: root/src/view.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-04-20 20:02:28 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-04-20 20:02:28 +0400
commit4d4668a0d4022583208d20bac9b8a0bede6f073d (patch)
tree14fbacb9511c738b40919aecbf168151605d28cb /src/view.c
parent6cc47586dbcbf21fb67be92f6736fd76ca8baffb (diff)
downloadrspamd-4d4668a0d4022583208d20bac9b8a0bede6f073d.tar.gz
rspamd-4d4668a0d4022583208d20bac9b8a0bede6f073d.zip
* Fix spf plugin that was broken in 0.4.7
* Add partial ipv6 support for some rspamd modules.
Diffstat (limited to 'src/view.c')
-rw-r--r--src/view.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/view.c b/src/view.c
index 7b70a07ca..6c67fce95 100644
--- a/src/view.c
+++ b/src/view.c
@@ -135,6 +135,24 @@ find_view_by_ip (GList * views, struct worker_task *task)
GList *cur;
struct rspamd_view *v;
+#ifdef HAVE_INET_PTON
+
+ if (task->from_addr.ipv6 || task->from_addr.d.in4.s_addr == INADDR_NONE) {
+ return NULL;
+ }
+
+ cur = views;
+ while (cur) {
+ v = cur->data;
+ if (radix32tree_find (v->ip_tree, ntohl (task->from_addr.d.in4.s_addr)) != RADIX_NO_VALUE) {
+ return v;
+ }
+ cur = g_list_next (cur);
+ }
+
+ return NULL;
+#else
+
if (task->from_addr.s_addr == INADDR_NONE) {
return NULL;
}
@@ -149,6 +167,7 @@ find_view_by_ip (GList * views, struct worker_task *task)
}
return NULL;
+#endif
}
static struct rspamd_view *